Module syntaxnbt

Class PathNodeIndex

java.lang.Object
at.syntaxerror.syntaxnbt.path.PathNode
at.syntaxerror.syntaxnbt.path.PathNodeIndex

public class PathNodeIndex extends PathNode
An NBT path node specifying an Element of a Named List or Array Tag
Author:
SyntaxError404
  • Constructor Details

    • PathNodeIndex

      public PathNodeIndex(String name, int index)
      Constructs a new "Element of Named List or Array Tag" path
      Parameters:
      name - name of the list/array tag
      index - index for the list/array
    • PathNodeIndex

      protected PathNodeIndex(int index)
      internal use only
      Parameters:
      index - the index
  • Method Details

    • traverseSelf

      public List<Tag<?>> traverseSelf(Tag<?> target)
      Description copied from class: PathNode
      Traverse through the tag's tree structure and return the matching tags. This does not respect the next node
      Specified by:
      traverseSelf in class PathNode
      Parameters:
      target - tag to traverse through
      Returns:
      the matching tags
    • stringify

      protected String stringify()
      Description copied from class: PathNode
      Stringifies only this node, without respecting the next node
      Specified by:
      stringify in class PathNode
      Returns:
      the string representation of this node