Class FSNode


  • public class FSNode
    extends FSTreeNode
    A node in the FS Tree Model A node is - an Feature Structure array -- elements may be other nodes - a primitive value, including Strings - a Feature Structure.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static int ARRAY_FS
      The Constant ARRAY_FS.
      private int arrayElemIdx
      The array elem idx.
      (package private) static int BOOL_FS
      The Constant BOOL_FS.
      (package private) static int BYTE_FS
      The Constant BYTE_FS.
      (package private) static int DISPLAY_NODE
      The Constant DISPLAY_NODE.
      (package private) static int DOUBLE_FS
      The Constant DOUBLE_FS.
      private Feature feat
      The feat.
      (package private) static int FLOAT_FS
      The Constant FLOAT_FS.
      private TOP fs
      The fs.
      private FSTreeModel fSTreeModel
      The s tree model.
      (package private) static int INT_FS
      The Constant INT_FS.
      private long intOrLongLikeValue
      The int or long like value.
      private boolean isArrayElem
      The is array elem.
      private boolean isShortenedString
      The is shortened string.
      (package private) static int LONG_FS
      The Constant LONG_FS.
      private static int maxStringLength
      The Constant maxStringLength.
      private int nodeClass
      The node class.
      (package private) static int SHORT_FS
      The Constant SHORT_FS.
      (package private) static int STD_FS
      The Constant STD_FS.
      private java.lang.String string
      The string.
      (package private) static int STRING_FS
      The Constant STRING_FS.
    • Constructor Summary

      Constructors 
      Constructor Description
      FSNode​(FSTreeModel fSTreeModel, int nodeClass, java.lang.Object fsOrString, long intOrLongLikeValue, int elementIndex)
      Instantiates a new FS node.
      FSNode​(FSTreeModel fSTreeModel, int nodeClass, java.lang.Object fsOrString, long intOrLongLikeValue, Feature feat)
      Instantiates a new FS node.
    • Field Detail

      • maxStringLength

        private static final int maxStringLength
        The Constant maxStringLength.
        See Also:
        Constant Field Values
      • fSTreeModel

        private final FSTreeModel fSTreeModel
        The s tree model.
      • nodeClass

        private final int nodeClass
        The node class.
      • intOrLongLikeValue

        private final long intOrLongLikeValue
        The int or long like value.
      • fs

        private final TOP fs
        The fs.
      • string

        private final java.lang.String string
        The string.
      • feat

        private final Feature feat
        The feat.
      • arrayElemIdx

        private final int arrayElemIdx
        The array elem idx.
      • isArrayElem

        private final boolean isArrayElem
        The is array elem.
      • isShortenedString

        private boolean isShortenedString
        The is shortened string.
    • Constructor Detail

      • FSNode

        FSNode​(FSTreeModel fSTreeModel,
               int nodeClass,
               java.lang.Object fsOrString,
               long intOrLongLikeValue,
               Feature feat)
        Instantiates a new FS node.
        Parameters:
        fSTreeModel - the f S tree model
        nodeClass - the node class
        fsOrString - the fs or string
        intOrLongLikeValue - the int or long like value
        feat - the feat
      • FSNode

        FSNode​(FSTreeModel fSTreeModel,
               int nodeClass,
               java.lang.Object fsOrString,
               long intOrLongLikeValue,
               int elementIndex)
        Instantiates a new FS node.
        Parameters:
        fSTreeModel - the f S tree model
        nodeClass - the node class
        fsOrString - the fs or string
        intOrLongLikeValue - the int or long like value
        elementIndex - the element index
    • Method Detail

      • k2nc

        private int k2nc​(SlotKinds.SlotKind kind)
        K 2 nc.
        Parameters:
        kind - the kind
        Returns:
        the int
      • getNodeClass

        int getNodeClass()
        Gets the node class.
        Returns:
        the node class
      • makeNodes

        private void makeNodes​(java.util.List<FSNode> arrayNodes,
                               int size,
                               java.util.function.IntFunction<FSNode> newFSNode)
        Make nodes.
        Parameters:
        arrayNodes - the array nodes
        newFSNode - the new FS node
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getFeatureString

        private java.lang.String getFeatureString()
        Gets the feature string.
        Returns:
        the feature string
      • isShortenedString

        boolean isShortenedString()
        Checks if is shortened string.
        Returns:
        if this is a string node displaying a shortened string
      • getFullString

        java.lang.String getFullString()
        Returns:
        for string nodes, return the string value (so it can be displayed seperately
      • getValueString

        private java.lang.String getValueString()
        Gets the value string.
        Returns:
        the value string
      • shortenString

        private static final java.lang.String shortenString​(java.lang.String s)
        Shorten string.
        Parameters:
        s - the s
        Returns:
        the string
      • escapeLt

        private static final java.lang.String escapeLt​(java.lang.String s)
        Escape lt.
        Parameters:
        s - the s
        Returns:
        the string
      • getNullString

        private java.lang.String getNullString()
        Gets the null string.
        Returns:
        the null string
      • getArrayPos

        int getArrayPos()
        Gets the array pos.
        Returns:
        the array pos
      • getType

        TypeImpl getType()
        Gets the type.
        Returns:
        the type
      • isAnnotation

        public boolean isAnnotation()
        Checks if is annotation.
        Returns:
        true, if is annotation
      • getStart

        public int getStart()
        Gets the start.
        Returns:
        the start
      • getEnd

        public int getEnd()
        Gets the end.
        Returns:
        the end