Class SimpleIndexedItem

All Implemented Interfaces:
HasIndexItem, IndexedItem, TaggableItem, Cloneable
Direct Known Subclasses:
TermItem

public abstract class SimpleIndexedItem extends SimpleTaggableItem implements IndexedItem
Common implementation for Item classes implementing the IndexedItem interface. Note that this file exist in 3 copies that should be kept in sync: CompositeIndexedItem.java SimpleIndexedItem.java IndexedSegmentItem.java These should only have trivial differences. (multiple inheritance or mixins would have been nice).
Author:
arnej27959
  • Constructor Details

    • SimpleIndexedItem

      public SimpleIndexedItem()
  • Method Details

    • getIndexName

      public String getIndexName()
      The name of the index this belongs to, or "" (never null) if not specified
      Specified by:
      getIndexName in interface HasIndexItem
    • encodeThis

      protected void encodeThis(ByteBuffer buffer)
      Overrides:
      encodeThis in class Item
    • setIndexName

      public void setIndexName(String index)
      Sets the name of the index to search
      Specified by:
      setIndexName in interface IndexedItem
      Specified by:
      setIndexName in class Item
    • appendIndexString

      protected void appendIndexString(StringBuilder buffer)
      Appends the index prefix if necessary
    • equals

      public boolean equals(Object object)
      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
    • getIndexedString

      public abstract String getIndexedString()
      Description copied from interface: IndexedItem
      Return the searchable term contents of this item.
      Specified by:
      getIndexedString in interface IndexedItem
      Returns:
      a string representation of what is presumably stored in an index which will match this item
    • disclose

      public void disclose(Discloser discloser)
      Overrides:
      disclose in class Item