Class BaseAmountable<T extends IAmountable>

  • Type Parameters:
    T -
    Direct Known Subclasses:
    AmountablePrice

    public class BaseAmountable<T extends IAmountable>
    extends java.lang.Object
    This base class for amountable items provides a count of the items.
    Author:
    Andi Hotz, (c) Sahits GmbH, 2011 Created on Dec 23, 2011
    • Constructor Summary

      Constructors 
      Constructor Description
      BaseAmountable()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int amount)
      Add a number items
      javafx.beans.property.ReadOnlyIntegerProperty amountProperty()  
      boolean equals​(java.lang.Object o)  
      int getAmount()
      Retrieve the number of items
      int hashCode()  
      void remove​(int amount)
      Remove a number of items
      void reset()
      Set the amount to 0.
      protected void setAmount​(int amount)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • amount

        private final javafx.beans.property.IntegerProperty amount
        Number of items that are amounted
    • Constructor Detail

      • BaseAmountable

        public BaseAmountable()
    • Method Detail

      • getAmount

        public int getAmount()
        Retrieve the number of items
        Returns:
        amount of items
      • setAmount

        protected void setAmount​(int amount)
      • amountProperty

        public javafx.beans.property.ReadOnlyIntegerProperty amountProperty()
      • add

        public void add​(int amount)
        Add a number items
        Parameters:
        amount - number of the items to be added
      • remove

        public void remove​(int amount)
        Remove a number of items
        Parameters:
        amount - of items to be removed
      • reset

        public void reset()
        Set the amount to 0.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object