Class SameElementItem

All Implemented Interfaces:
Cloneable

public class SameElementItem extends NonReducibleCompositeItem
This represents a query where all terms are required to match in the same element id. The primary usecase is to allow efficient search in arrays and maps of struct. The common path is the field name containing the struct.
Author:
baldersheim
  • Constructor Details

    • SameElementItem

      public SameElementItem(String commonPath)
  • Method Details

    • encodeThis

      protected void encodeThis(ByteBuffer buffer)
      Description copied from class: CompositeItem
      Encodes just this item, not its regular subitems, to the given buffer.
      Overrides:
      encodeThis in class CompositeItem
    • appendHeadingString

      protected void appendHeadingString(StringBuilder buffer)
      Description copied from class: Item
      Appends the heading of this string. As default getName() followed by a space.
      Overrides:
      appendHeadingString 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 CompositeItem
    • adding

      protected void adding(Item item)
      Overrides:
      adding in class CompositeItem
    • extractSingleChild

      public Optional<Item> extractSingleChild()
      Description copied from class: CompositeItem
      Returns the single child of this, if this can be omitted without changes to recall semantics.
      Overrides:
      extractSingleChild in class NonReducibleCompositeItem
    • getItemType

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

      public String getName()
      Description copied from class: Item
      Returns the name of this item
      Specified by:
      getName in class Item
    • getFieldName

      public String getFieldName()
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class CompositeItem