|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectstella.util.HistoryDatabase
public class HistoryDatabase
This class restores the target history database from a master log file. It pursues as follows:
TARGETPICKED,
the (unique) name of the target is deduced from the part of this line
after TARGETPICKED until the separator char AT. The
merit of this possible pick is the number following to the first space,
then the starting date of that pick is read in the format
dd MM yyyy HH:mm:ss zzz.UNIQUE restores the unique
pick ID.TARGETFINISHEDHEAD targetname TARGETFINISHEDTAIL is
found, before a new target was picked. This end line also
carries the end of the observation, which is used to deduce the duration
of the pick from.TARGETPICKED and
the line defined above a line with ABORTTARGET is encountered,
the pick is rendered unsuccessful, otherwise we deduce a successful
pick.
| 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 |
|---|
public static final String TARGETPICKED
public static final String AT
public static final String UNIQUE
public static final String TARGETFINISHEDHEAD
public static final String TARGETFINISHEDTAIL
public static final String ABORTTARGET
public static final String SHUTDOWN
public static final int SKIP
public static final DateFormat df
private HistorySql sql
| Constructor Detail |
|---|
public HistoryDatabase(PropertySupplying db)
| Method Detail |
|---|
public Map getPicks(Date start,
Date end)
public boolean parseFromReader(Reader log)
throws IOException,
ParseException
log - The stream of the log data, possibly from a file.
IOException
ParseException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||