Class DayPlanParser
Class DayPlanParser
java.lang.Object
|
+----DayPlanParser
- public class DayPlanParser
- extends Object
DayPlanParser is an abstract class for parsing data in a .dayplan
file.
-
DayPlanParser()
-
-
readBooleanOption(StringTokenizer, char)
- Reads in a boolean option from a StringTokenizer.
-
readBooleanOption(OptionArray, char)
- Reads a boolean option from an OptionArray.
-
readBooleanOption(StringTokenizer)
- Reads in a boolean option from a StringTokenizer.
-
readBooleanOption(OptionArray)
- Reads a boolean option from an OptionArray.
-
readDateOption(StringTokenizer)
- Reads in a date option from a StringTokenizer.
-
readIntegerOption(StringTokenizer)
- Reads in an integer option from a StringTokenizer.
-
readTimeLengthOption(StringTokenizer)
- Reads in a time option from a StringTokenizer, and converts it
to a length (number of seconds from 0:00:00).
-
readTimeOption(StringTokenizer)
- Reads in a time option from a StringTokenizer.
-
readTimeOption(StringTokenizer, Date)
- Reads in a time option from a StringTokenizer, and modifies the
given Date to be that time.
DayPlanParser
public DayPlanParser()
readBooleanOption
public boolean readBooleanOption(StringTokenizer options,
char on) throws DayPlanParserException
- Reads in a boolean option from a StringTokenizer. In the .dayplan
file, options are set to be '-' if they are turned off, or to a
specific character when they are on. This routine increments the
StringTokenizer.
- Parameters:
- options - the StringTokenizer to read from
- on - the character which represents that the option is on
- Returns:
- true if the token is the on character, false if '-'
- Throws: DayPlanParserException
- when there is an error in reading
- See Also:
- StringTokenizer
readBooleanOption
public boolean readBooleanOption(OptionArray options,
char on) throws DayPlanParserException
- Reads a boolean option from an OptionArray. Options in the
.dayplan file are often bunched up next to one another, with
no spaces in between. A StringTokenizer cannot parse this,
but placing the options into an array can. This routine
increments the OptionArray.
- Parameters:
- options - the OptionArray to read from
- on - the character which represents that the option is on
- Returns:
- true if the next option is the on character, false if '-'
- Throws: DayPlanParserException
- when there is an error in reading
- See Also:
- StringTokenizer, OptionArray
readBooleanOption
public boolean readBooleanOption(StringTokenizer options) throws DayPlanParserException
- Reads in a boolean option from a StringTokenizer. In the .dayplan
file, some options are set to be '0' if they are turned off, or to '1'
when they are on. This routine increments the StringTokenizer.
- Parameters:
- options - the StringTokenizer to read from
- Returns:
- true if the token is '1', false if '0'
- Throws: DayPlanParserException
- when there is an error in reading
- See Also:
- StringTokenizer
readBooleanOption
public boolean readBooleanOption(OptionArray options) throws DayPlanParserException
- Reads a boolean option from an OptionArray. Options in the
.dayplan file are often bunched up next to one another, with
no spaces in between. A StringTokenizer cannot parse this,
but placing the options into an array can. This routine
increments the OptionArray.
- Parameters:
- options - the OptionArray to read from
- Returns:
- true if the next option is '1', false if '0'
- Throws: DayPlanParserException
- when there is an error in reading
- See Also:
- StringTokenizer, OptionArray
readIntegerOption
public int readIntegerOption(StringTokenizer options) throws DayPlanParserException
- Reads in an integer option from a StringTokenizer.
This routine increments the StringTokenizer.
- Parameters:
- options - the StringTokenizer to read from
- Returns:
- the integer representation of the next token
- Throws: DayPlanParserException
- when there is an error in reading
- See Also:
- StringTokenizer
readDateOption
public Day readDateOption(StringTokenizer options) throws DayPlanParserException
- Reads in a date option from a StringTokenizer.
This routine increments the StringTokenizer, and broadens the
delimeter set.
- Parameters:
- options - the StringTokenizer to read from
- Returns:
- the Day represented by the next token
- Throws: DayPlanParserException
- when there is an error in reading
- See Also:
- StringTokenizer, Day
readTimeOption
public Time readTimeOption(StringTokenizer options) throws DayPlanParserException
- Reads in a time option from a StringTokenizer.
This routine increments the StringTokenizer, and broadens the
delimeter set.
- Parameters:
- options - the StringTokenizer to read from
- Returns:
- the Time represented by the next token
- Throws: DayPlanParserException
- when there is an error in reading
- See Also:
- StringTokenizer, Time
readTimeLengthOption
public int readTimeLengthOption(StringTokenizer options) throws DayPlanParserException
- Reads in a time option from a StringTokenizer, and converts it
to a length (number of seconds from 0:00:00).
This routine increments the StringTokenizer, and broadens the
delimeter set.
- Parameters:
- options - the StringTokenizer to read from
- Returns:
- the length of time since 0:00:00
- Throws: DayPlanParserException
- when there is an error in reading
- See Also:
- StringTokenizer
readTimeOption
public Date readTimeOption(StringTokenizer options,
Date day) throws DayPlanParserException
- Reads in a time option from a StringTokenizer, and modifies the
given Date to be that time.
This routine increments the StringTokenizer, and broadens the
delimeter set.
- Parameters:
- options - the StringTokenizer to read from
- Returns:
- the new Date
- Throws: DayPlanParserException
- when there is an error in reading
- See Also:
- StringTokenizer, Date