Class Item


  • public class Item
    extends java.lang.Object
    A class representing an item in Eressea. Items are qualified by their type and a certain amount. Mark that the item class is quite 'bare', i.e. its name and identifiability are not enforced by sub-classing the respective interfaces.
    • Constructor Summary

      Constructors 
      Constructor Description
      Item​(ItemType type, int amount)
      Creates a new item of the specified type and with the specified amount.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      int getAmount()
      Returns the amount, i.e. the number of entities this item represents.
      ItemType getItemType()
      Returns the type of this item.
      java.lang.String getName()
      This method is a shortcut for calling this.getType().getName()
      java.lang.String getOrderName()
      Returns the name, quoted if required.
      ItemType getType()
      Deprecated.
      Use getItemType() instead
      boolean isChanged()  
      void setAmount​(int amount)
      Sets the amount.
      void setChanged​(boolean changed)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Item

        public Item​(ItemType type,
                    int amount)
        Creates a new item of the specified type and with the specified amount.
        Throws:
        java.lang.NullPointerException - if type==null
    • Method Detail

      • setAmount

        public void setAmount​(int amount)
        Sets the amount.
      • getAmount

        public int getAmount()
        Returns the amount, i.e. the number of entities this item represents.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()
      • getItemType

        public ItemType getItemType()
        Returns the type of this item.
      • getType

        @Deprecated
        public ItemType getType()
        Deprecated.
        Use getItemType() instead
        Returns the type of this item.
      • getName

        public java.lang.String getName()
        This method is a shortcut for calling this.getType().getName()
      • getOrderName

        public java.lang.String getOrderName()
        Returns the name, quoted if required.
      • isChanged

        public boolean isChanged()
      • setChanged

        public void setChanged​(boolean changed)