stella.util
Class HistoryDatabase

java.lang.Object
  extended by stella.util.HistoryDatabase

public class HistoryDatabase
extends Object

This class restores the target history database from a master log file. It pursues as follows:

This class uses the same methods as the master mind to enter targets, thus any changes in these classes will be reflected here.


Nested Class Summary
static class HistoryDatabase.Logfile
          Simple command line interface.
 
Field Summary
static String ABORTTARGET
          If a line containing this string is found, pick is unsuccessful.
static String AT
          The separator in the pick block starting line between name and merit.
static DateFormat df
          The date formatter for parsing start and end of pick.
static String SHUTDOWN
          If a line containing this string is found, pick is unsuccessful.
static int SKIP
          The number of chars to skip on the line start.
private  HistorySql sql
          The histroy sql interface.
static String TARGETFINISHEDHEAD
          The first part of the line defining the end of a pick block.
static String TARGETFINISHEDTAIL
          The second part of the line defining the end of a pick block.
static String TARGETPICKED
          This is the start of the line that defines a possible pick block.
static String UNIQUE
          The second line in the pick block defining the unique number.
 
Constructor Summary
HistoryDatabase(PropertySupplying db)
          Construct a new history database restoring object.
 
Method Summary
 Map getPicks(Date start, Date end)
          Returns all picks.
 boolean parseFromReader(Reader log)
          Takes the reader, wraps it into a buffered reader and parses the picks from it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TARGETPICKED

public static final String TARGETPICKED
This is the start of the line that defines a possible pick block.

See Also:
Constant Field Values

AT

public static final String AT
The separator in the pick block starting line between name and merit.

See Also:
Constant Field Values

UNIQUE

public static final String UNIQUE
The second line in the pick block defining the unique number.

See Also:
Constant Field Values

TARGETFINISHEDHEAD

public static final String TARGETFINISHEDHEAD
The first part of the line defining the end of a pick block.

See Also:
Constant Field Values

TARGETFINISHEDTAIL

public static final String TARGETFINISHEDTAIL
The second part of the line defining the end of a pick block.

See Also:
Constant Field Values

ABORTTARGET

public static final String ABORTTARGET
If a line containing this string is found, pick is unsuccessful.

See Also:
Constant Field Values

SHUTDOWN

public static final String SHUTDOWN
If a line containing this string is found, pick is unsuccessful.

See Also:
Constant Field Values

SKIP

public static final int SKIP
The number of chars to skip on the line start.

See Also:
Constant Field Values

df

public static final DateFormat df
The date formatter for parsing start and end of pick.


sql

private HistorySql sql
The histroy sql interface.

Constructor Detail

HistoryDatabase

public HistoryDatabase(PropertySupplying db)
Construct a new history database restoring object. The properties are the properties of the database.

Method Detail

getPicks

public Map getPicks(Date start,
                    Date end)
Returns all picks.


parseFromReader

public boolean parseFromReader(Reader log)
                        throws IOException,
                               ParseException
Takes the reader, wraps it into a buffered reader and parses the picks from it.

Parameters:
log - The stream of the log data, possibly from a file.
Returns:
True on errorless parsing.
Throws:
IOException
ParseException