Package adams.parser

Class 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)
    • Field Detail

      • m_Type

        protected int m_Type
        the type.
      • m_Amount

        protected int m_Amount
        the amount.
    • 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 type
        amount - the amount
      • TimeAmount

        public TimeAmount​(int type,
                          int amount,
                          TimeAmount.Note note)
        Initializes the object with specified amount and type.
        Parameters:
        type - the type
        amount - the amount
        note - 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
      • toString

        public String toString()
        Returns a string representation of the amount.
        Overrides:
        toString in class Object
        Returns:
        the string representation