public class HistoryDatabase extends Object
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.| Modifier and Type | Class and Description |
|---|---|
static class |
HistoryDatabase.Logfile
Simple command line interface.
|
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
HistoryDatabase(PropertySupplying db)
Construct a new history database restoring object.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
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 final HistorySql sql
public HistoryDatabase(PropertySupplying db) throws InitException
InitExceptionpublic boolean parseFromReader(Reader log) throws IOException, ParseException
log - The stream of the log data, possibly from a file.IOExceptionParseException