Class TextItem

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

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

    • TextItem

      public TextItem()
    • TextItem

      public TextItem(Node textNode)
    • TextItem

      public TextItem(String content)
      Create a new Text Node with the given content.
      Parameters:
      content - the content of the text node
  • 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
    • setParent

      public void setParent(Item parent)
      Specified by:
      setParent in interface Item
    • 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.
    • getTextValue

      public String getTextValue()
      Description copied from interface: Item
      Returns the string value of the text item, if it is a text item.
      Specified by:
      getTextValue in interface Item
      Returns:
      the string value.
    • getEffectiveBooleanValue

      public boolean getEffectiveBooleanValue()
      Description copied from interface: Item
      Returns the effective boolean value of the item, if atomic.
      Specified by:
      getEffectiveBooleanValue in interface Item
      Returns:
      the effective boolean value.
    • 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
    • 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.
    • 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.
    • parent

      public Item parent()
      Specified by:
      parent 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.
    • 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.
    • isTextNode

      public boolean isTextNode()
      Specified by:
      isTextNode in interface Item
    • nodeName

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

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