Class AttributeItem

java.lang.Object
org.rumbledb.items.xml.AttributeItem
All Implemented Interfaces:
com.esotericsoftware.kryo.KryoSerializable, Serializable, Item

public class AttributeItem extends Object implements Item
See Also:
  • Constructor Details

    • AttributeItem

      public AttributeItem()
    • AttributeItem

      public AttributeItem(Node attributeNode)
    • AttributeItem

      public AttributeItem(String nodeName, String stringValue)
      Constructor for an attribute item.
      Parameters:
      nodeName - The name of the attribute
      stringValue - The string value of the attribute
  • Method Details

    • setXmlDocumentPosition

      public int setXmlDocumentPosition(String path, int current)
      Description copied from interface: Item
      Set the position of the Node inside the XML document (and path incase of multiple docs) for sorting / uniqueness
      Specified by:
      setXmlDocumentPosition in interface Item
      Parameters:
      path - the path of the XML document
      current - the current position
      Returns:
      the new position
    • getXmlDocumentPosition

      public XMLDocumentPosition getXmlDocumentPosition()
      Description copied from interface: Item
      Get the position of the Node inside the XML document (and path incase of multiple docs) for sorting / uniqueness
      Specified by:
      getXmlDocumentPosition in interface Item
      Returns:
      the XML document position
    • write

      public void write(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output)
      Specified by:
      write in interface com.esotericsoftware.kryo.KryoSerializable
    • read

      public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input)
      Specified by:
      read in interface com.esotericsoftware.kryo.KryoSerializable
    • nodeName

      public String nodeName()
      Specified by:
      nodeName in interface Item
    • parent

      public Item parent()
      Specified by:
      parent in interface Item
    • getStringValue

      public String getStringValue()
      Description copied from interface: Item
      Returns the string value of the item, if it is an atomic item.
      Specified by:
      getStringValue in interface Item
      Returns:
      the string value.
    • setParent

      public void setParent(Item parent)
      Specified by:
      setParent in interface Item
    • getDynamicType

      public ItemType getDynamicType()
      Description copied from interface: Item
      Returns the dynamic type of the item (only for error message purposes).
      Specified by:
      getDynamicType in interface Item
      Returns:
      the dynamic type as an item type.
    • equals

      public boolean equals(Object other)
      Description copied from interface: Item
      Tests for logical equality. The semantics are that of the eq operator.
      Specified by:
      equals in interface Item
      Overrides:
      equals in class Object
      Parameters:
      other - another item.
      Returns:
      true it is equal to other, false otherwise.
    • isNode

      public boolean isNode()
      Description copied from interface: Item
      Tests whether the item is an XML node.
      Specified by:
      isNode in interface Item
      Returns:
      true if it is an XML node, false otherwise.
    • isAttributeNode

      public boolean isAttributeNode()
      Description copied from interface: Item
      Tests whether the item is an XML Attribute node.
      Specified by:
      isAttributeNode in interface Item
      Returns:
      true if it is an XML Attribute node, false otherwise.
    • hashCode

      public int hashCode()
      Description copied from interface: Item
      Computes a hash code.
      Specified by:
      hashCode in interface Item
      Overrides:
      hashCode in class Object
      Returns:
      a hash code as an int.
    • atomizedValue

      public List<Item> atomizedValue()
      Specified by:
      atomizedValue in interface Item