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.

Constructor Index

 o DayPlanParser()

Method Index

 o readBooleanOption(StringTokenizer, char)
Reads in a boolean option from a StringTokenizer.
 o readBooleanOption(OptionArray, char)
Reads a boolean option from an OptionArray.
 o readBooleanOption(StringTokenizer)
Reads in a boolean option from a StringTokenizer.
 o readBooleanOption(OptionArray)
Reads a boolean option from an OptionArray.
 o readDateOption(StringTokenizer)
Reads in a date option from a StringTokenizer.
 o readIntegerOption(StringTokenizer)
Reads in an integer option from a StringTokenizer.
 o readTimeLengthOption(StringTokenizer)
Reads in a time option from a StringTokenizer, and converts it to a length (number of seconds from 0:00:00).
 o readTimeOption(StringTokenizer)
Reads in a time option from a StringTokenizer.
 o readTimeOption(StringTokenizer, Date)
Reads in a time option from a StringTokenizer, and modifies the given Date to be that time.

Constructors

 o DayPlanParser
  public DayPlanParser()

Methods

 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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