java.lang.Object
de.fraunhofer.iosb.ilt.frostserver.util.wktparser.nodes.BaseNode
All Implemented Interfaces:
de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node, Iterable<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node>, Collection<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node>, List<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node>
Direct Known Subclasses:
Coords2, Coords3, LinearRing, Start, WktLineString, WktMultiPoint, WktPoint, WktPolygon

public class BaseNode extends Object implements de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
The base concrete class for non-terminal Nodes
  • Nested Class Summary

    Nested classes/interfaces inherited from interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node

    de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node.NodeType, de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node.TerminalNode, de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node.Visitor
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(int i, de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node n)
     
    boolean
    add(de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node n)
     
    boolean
    addAll(int i, Collection<? extends de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node> nodes)
     
    boolean
    addAll(Collection<? extends de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node> nodes)
     
    void
    addChild(int i, de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node n)
    inserts a child Node at a specific index, displacing the nodes after the index by 1.
    void
    addChild(de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node n)
    appends a child Node
    void
    addToNamedChildList(String name, de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node node)
     
    List<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node>
     
    void
     
    void
    Remove all the child nodes
    boolean
     
    de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
    get(int i)
     
    int
     
    de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
    getChild(int i)
     
    int
     
    int
     
    de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
     
    List<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node>
     
    de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
     
    List<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Token>
     
    de.fraunhofer.iosb.ilt.frostserver.util.wktparser.WLexer
     
    boolean
     
    de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
    remove(int i)
     
    boolean
     
    de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
    removeChild(int i)
    Remove the node at index i.
    boolean
     
    de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
    set(int i, de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node n)
     
    void
    setBeginOffset(int beginOffset)
    Set the offset where the token begins, expressed in code units.
    void
    setChild(int i, de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node n)
    Replace the node at index i
    void
    setEndOffset(int endOffset)
    Set the offset where the token ends, actually the location where the very next token should begin.
    static void
    setListClass(Class<? extends List> listClass)
    Sets the List class that is used to store child nodes.
    void
    setNamedChild(String name, de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node node)
     
    void
    setParent(de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node n)
     
    void
    setTokenSource(de.fraunhofer.iosb.ilt.frostserver.util.wktparser.TokenSource tokenSource)
     
    void
    setUnparsed(boolean unparsed)
    Mark whether this Node is unparsed, i.e.
    List<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node>
    subList(int from, int to)
     
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.util.Collection

    parallelStream, removeIf, stream, toArray

    Methods inherited from interface java.lang.Iterable

    forEach

    Methods inherited from interface java.util.List

    equals, hashCode, replaceAll, sort, spliterator

    Methods inherited from interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node

    appendChild, children, childrenOfType, childrenOfType, childrenOfType, childrenOfType, close, contains, copyLocationInfo, copyLocationInfo, descendants, descendants, descendants, descendants, descendantsOfType, descendantsOfType, dump, dump, firstAncestorOfType, firstChildOfType, firstChildOfType, firstChildOfType, firstDescendantOfType, firstDescendantOfType, firstDescendantOfType, firstDescendantOfType, getAllTokens, getBeginColumn, getBeginLine, getEndColumn, getEndLine, getFirstChild, getImage, getInputSource, getLastChild, getLength, getLocation, getRoot, getSource, getTokenType, getType, hasChildNodes, indexOf, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, nextSibling, open, prependChild, previousSibling, remove, removeChild, replace, replace, replaceChild, size, toArray, toArray
  • Constructor Details

    • BaseNode

      public BaseNode()
  • Method Details

    • getTokenSource

      public de.fraunhofer.iosb.ilt.frostserver.util.wktparser.WLexer getTokenSource()
      Specified by:
      getTokenSource in interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
      Returns:
      the #TokenSource from which this Node object originated. There is no guarantee that this doesn't return null. Most likely that would simply be because you constructed the Node yourself, i.e. it didn't really come about via the parsing/tokenizing machinery.
    • setTokenSource

      public void setTokenSource(de.fraunhofer.iosb.ilt.frostserver.util.wktparser.TokenSource tokenSource)
      Specified by:
      setTokenSource in interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
    • setListClass

      public static void setListClass(Class<? extends List> listClass)
      Sets the List class that is used to store child nodes. By default, this is java.util.ArrayList. There is probably very little reason to ever use anything else, though you could use this method to replace this with LinkedList or your own java.util.List implementation even.
      Parameters:
      listClass - the #java.util.List implementation to use internally for the child nodes. By default #java.util.ArrayList is used.
    • isUnparsed

      public boolean isUnparsed()
      Specified by:
      isUnparsed in interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
      Returns:
      whether this Node was created by regular operations of the parsing machinery.
    • setUnparsed

      public void setUnparsed(boolean unparsed)
      Description copied from interface: de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
      Mark whether this Node is unparsed, i.e. not the result of normal parsing
      Specified by:
      setUnparsed in interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
      Parameters:
      unparsed - whether to set the Node as unparsed or parsed.
    • setParent

      public void setParent(de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node n)
      Specified by:
      setParent in interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
      Parameters:
      n - The Node to set as the parent. Mostly used internally. The various addChild or appendChild sorts of methods should use this to set the node's parent.
    • getParent

      public de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node getParent()
      Specified by:
      getParent in interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
      Returns:
      this node's parent Node
    • addChild

      public void addChild(de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node n)
      Description copied from interface: de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
      appends a child Node
      Specified by:
      addChild in interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
    • addChild

      public void addChild(int i, de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node n)
      Description copied from interface: de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
      inserts a child Node at a specific index, displacing the nodes after the index by 1.
      Specified by:
      addChild in interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
      Parameters:
      i - the (zero-based) index at which to insert the node
      n - the Node to insert
    • getChild

      public de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node getChild(int i)
      Specified by:
      getChild in interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
      Parameters:
      i - the index of the Node to return
      Returns:
      the Node at the specific offset
    • setChild

      public void setChild(int i, de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node n)
      Description copied from interface: de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
      Replace the node at index i
      Specified by:
      setChild in interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
      Parameters:
      i - the index
      n - the node
    • removeChild

      public de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node removeChild(int i)
      Description copied from interface: de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
      Remove the node at index i. Any Nodes after i are shifted to the left.
      Specified by:
      removeChild in interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
      Parameters:
      i - the index at which to remove
      Returns:
      the removed Node
    • remove

      public de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node remove(int i)
      Specified by:
      remove in interface List<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node>
    • clearChildren

      public void clearChildren()
      Description copied from interface: de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
      Remove all the child nodes
      Specified by:
      clearChildren in interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
    • getChildCount

      public int getChildCount()
      Specified by:
      getChildCount in interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
      Returns:
      the number of child nodes
    • children

      public List<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node> children()
      Specified by:
      children in interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
    • getBeginOffset

      public int getBeginOffset()
      Specified by:
      getBeginOffset in interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
      Returns:
      the offset in the input source where the token begins, expressed in code units.
    • setBeginOffset

      public void setBeginOffset(int beginOffset)
      Description copied from interface: de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
      Set the offset where the token begins, expressed in code units.
      Specified by:
      setBeginOffset in interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
    • getEndOffset

      public int getEndOffset()
      Specified by:
      getEndOffset in interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
      Returns:
      the offset in the input source where the token ends, expressed in code units. This is actually the offset where the very next token would begin.
    • setEndOffset

      public void setEndOffset(int endOffset)
      Description copied from interface: de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
      Set the offset where the token ends, actually the location where the very next token should begin.
      Specified by:
      setEndOffset in interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
    • subList

      public List<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node> subList(int from, int to)
      Specified by:
      subList in interface List<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node>
      Specified by:
      subList in interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
    • getRealTokens

      public List<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Token> getRealTokens()
    • add

      public void add(int i, de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node n)
      Specified by:
      add in interface List<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node>
    • get

      public de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node get(int i)
      Specified by:
      get in interface List<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node>
    • set

      public de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node set(int i, de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node n)
      Specified by:
      set in interface List<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node>
    • add

      public boolean add(de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node n)
      Specified by:
      add in interface Collection<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node>
      Specified by:
      add in interface List<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node>
    • clear

      public void clear()
      Specified by:
      clear in interface Collection<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node>
      Specified by:
      clear in interface List<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node>
      Specified by:
      clear in interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
    • addAll

      public boolean addAll(Collection<? extends de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node> nodes)
      Specified by:
      addAll in interface Collection<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node>
      Specified by:
      addAll in interface List<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node>
      Specified by:
      addAll in interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
    • addAll

      public boolean addAll(int i, Collection<? extends de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node> nodes)
      Specified by:
      addAll in interface List<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node>
      Specified by:
      addAll in interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
    • containsAll

      public boolean containsAll(Collection<?> nodes)
      Specified by:
      containsAll in interface Collection<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node>
      Specified by:
      containsAll in interface List<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node>
      Specified by:
      containsAll in interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
    • retainAll

      public boolean retainAll(Collection<?> nodes)
      Specified by:
      retainAll in interface Collection<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node>
      Specified by:
      retainAll in interface List<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node>
      Specified by:
      retainAll in interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
    • removeAll

      public boolean removeAll(Collection<?> nodes)
      Specified by:
      removeAll in interface Collection<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node>
      Specified by:
      removeAll in interface List<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node>
      Specified by:
      removeAll in interface de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getNamedChild

      public de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node getNamedChild(String name)
    • setNamedChild

      public void setNamedChild(String name, de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node node)
    • getNamedChildList

      public List<de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node> getNamedChildList(String name)
    • addToNamedChildList

      public void addToNamedChildList(String name, de.fraunhofer.iosb.ilt.frostserver.util.wktparser.Node node)