com.exponto.jstock
Class Lines

java.lang.Object
  extended bycom.exponto.jstock.Lines

public class Lines
extends java.lang.Object


Constructor Summary
Lines(TickerID id, boolean isWeekly)
          Creates a new set of Lines
 
Method Summary
 void addLine(PersistentLine pL)
           
 void changeCurrentLine(int i)
          Sets the currentPosition to currentPosition + i.
 void deleteActiveSelection()
          Deletes the line that is active
 PersistentLine getActive()
          Gets the currently active line.
 TickerID getTickerId()
          Get the TickerID associated with the lines.
 int getType()
          The type of chart.
 PersistentLine hasNext()
          Gets the next PersistenLine if there is more.
 void loadLines()
          Load lines from the database
 void removeCurrentLine()
           
 void reset()
          Sets the currentPosition to the first line in the ArrayList
 void saveLines()
          Saves all lines not marked as deleted into the database.
 boolean selectNext(boolean keepSelected)
           
 void selectNextEnd()
           
 boolean selectPrevious(boolean keepSelected)
           
 void setActive(PersistentLine pL)
          Updates the position of the active line.
 void setTickerId(TickerID id)
          Sets the TickerID
 void setType(boolean isWeekly)
          Sets the type of chart theese lines are valid for
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lines

public Lines(TickerID id,
             boolean isWeekly)
Creates a new set of Lines

Parameters:
id - os the - TickerID that this Lines is associated with
isWeekly - - if the lines are for a weekly chart or not
Method Detail

reset

public void reset()
Sets the currentPosition to the first line in the ArrayList


changeCurrentLine

public void changeCurrentLine(int i)
Sets the currentPosition to currentPosition + i. Note: No check of bounds here

Parameters:
i - integer to add to the currentPosition

hasNext

public PersistentLine hasNext()
Gets the next PersistenLine if there is more. Increments the currentPosition.

Returns:
the next PersistentLine if exist, null otherwise.

getActive

public PersistentLine getActive()
Gets the currently active line.

Returns:
the PersistentLine currently marked as active.

setActive

public void setActive(PersistentLine pL)
Updates the position of the active line.

Parameters:
pL - the PersistentLine that shall be updated

addLine

public void addLine(PersistentLine pL)

removeCurrentLine

public void removeCurrentLine()

selectNext

public boolean selectNext(boolean keepSelected)
Parameters:
keepSelected - if false all selection is reset.
Returns:
true if a new PersistentLine is selected

selectPrevious

public boolean selectPrevious(boolean keepSelected)
Parameters:
keepSelected - if false all selection is reset.
Returns:
true if a new PersistentLine is selected

selectNextEnd

public void selectNextEnd()

deleteActiveSelection

public void deleteActiveSelection()
Deletes the line that is active


loadLines

public void loadLines()
Load lines from the database


saveLines

public void saveLines()
Saves all lines not marked as deleted into the database. The lines are read back from the database.


getTickerId

public TickerID getTickerId()
Get the TickerID associated with the lines.

Returns:
the TickerId

getType

public int getType()
The type of chart.

Returns:
the type (either daily or weekly)

setTickerId

public void setTickerId(TickerID id)
Sets the TickerID

Parameters:
id - The TickerId

setType

public void setType(boolean isWeekly)
Sets the type of chart theese lines are valid for

Parameters:
isWeekly - boolean that indicates of this is lines for a weekly chart or not.


Copyright © 2004 Kaare Ranum