Package adams.parser
Class TimeAmount
- java.lang.Object
-
- adams.parser.TimeAmount
-
public class TimeAmount extends Object
Helper class for date manipulations (adding, substracting), stores the type and amount.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
Calendar.add(int, int)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TimeAmount.Note
enum of notes.
-
Field Summary
Fields Modifier and Type Field Description protected int
m_Amount
the amount.protected TimeAmount.Note
m_Note
the note.protected int
m_Type
the type.
-
Constructor Summary
Constructors Constructor Description TimeAmount(int type)
Initializes the object with amount 1 of the specified type.TimeAmount(int type, int amount)
Initializes the object with specified amount and type.TimeAmount(int type, int amount, TimeAmount.Note note)
Initializes the object with specified amount and type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAmount()
Returns the amount.TimeAmount.Note
getNote()
Returns the note.int
getType()
Returns the type.String
toString()
Returns a string representation of the amount.
-
-
-
Field Detail
-
m_Type
protected int m_Type
the type.
-
m_Amount
protected int m_Amount
the amount.
-
m_Note
protected TimeAmount.Note m_Note
the note.
-
-
Constructor Detail
-
TimeAmount
public TimeAmount(int type)
Initializes the object with amount 1 of the specified type.- Parameters:
type
- the type
-
TimeAmount
public TimeAmount(int type, int amount)
Initializes the object with specified amount and type.- Parameters:
type
- the typeamount
- the amount
-
TimeAmount
public TimeAmount(int type, int amount, TimeAmount.Note note)
Initializes the object with specified amount and type.- Parameters:
type
- the typeamount
- the amountnote
- the note
-
-
Method Detail
-
getType
public int getType()
Returns the type.- Returns:
- the type
-
getAmount
public int getAmount()
Returns the amount.- Returns:
- the amount
-
getNote
public TimeAmount.Note getNote()
Returns the note.- Returns:
- the note
-
-