Class PureWeightedInteger

  • All Implemented Interfaces:
    Cloneable

    public class PureWeightedInteger
    extends PureWeightedItem
    An integer item which only consists of a value and weight.
    Author:
    baldersheim
    • Constructor Detail

      • PureWeightedInteger

        public PureWeightedInteger​(long value)
      • PureWeightedInteger

        public PureWeightedInteger​(long value,
                                   int weight)
    • Method Detail

      • getItemType

        public Item.ItemType getItemType()
        Description copied from class: Item
        Return the enumerated type of this item.
        Specified by:
        getItemType in class Item
      • getTermCount

        public int getTermCount()
        Specified by:
        getTermCount in class Item
      • appendBodyString

        protected void appendBodyString​(StringBuilder buffer)
        Description copied from class: Item
        Override to append the item body in the canonical query language of this item. An item is usually represented by the string
         ([itemName] [body])
         
        The body must be appended appended by this method.
        Overrides:
        appendBodyString in class PureWeightedItem
      • getValue

        public long getValue()
      • equals

        public boolean equals​(Object other)
        Description copied from class: Item
        Returns whether this item is of the same class and contains the same state as the given item.
        Overrides:
        equals in class Item
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Item