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 classTimeAmount.Noteenum of notes.
-
Field Summary
Fields Modifier and Type Field Description protected intm_Amountthe amount.protected TimeAmount.Notem_Notethe note.protected intm_Typethe 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 intgetAmount()Returns the amount.TimeAmount.NotegetNote()Returns the note.intgetType()Returns the type.StringtoString()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
-
-