Package org.apache.uima.tools.cvd
Class FSNode
- java.lang.Object
-
- org.apache.uima.tools.cvd.FSTreeNode
-
- org.apache.uima.tools.cvd.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.-
Fields inherited from class org.apache.uima.tools.cvd.FSTreeNode
children
-
-
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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.String
escapeLt(java.lang.String s)
Escape lt.(package private) int
getArrayPos()
Gets the array pos.int
getEnd()
Gets the end.private java.lang.String
getFeatureString()
Gets the feature string.(package private) java.lang.String
getFullString()
(package private) int
getNodeClass()
Gets the node class.private java.lang.String
getNullString()
Gets the null string.int
getStart()
Gets the start.(package private) TypeImpl
getType()
Gets the type.private java.lang.String
getValueString()
Gets the value string.protected void
initChildren()
Inits the children.boolean
isAnnotation()
Checks if is annotation.(package private) boolean
isShortenedString()
Checks if is shortened string.private int
k2nc(SlotKinds.SlotKind kind)
K 2 nc.private void
makeNodes(java.util.List<FSNode> arrayNodes, int size, java.util.function.IntFunction<FSNode> newFSNode)
Make nodes.private static java.lang.String
shortenString(java.lang.String s)
Shorten string.java.lang.String
toString()
-
Methods inherited from class org.apache.uima.tools.cvd.FSTreeNode
getChildCount, getChildren, removeAllChildren, setChildren
-
-
-
-
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.
-
INT_FS
static final int INT_FS
The Constant INT_FS.- See Also:
- Constant Field Values
-
FLOAT_FS
static final int FLOAT_FS
The Constant FLOAT_FS.- See Also:
- Constant Field Values
-
STRING_FS
static final int STRING_FS
The Constant STRING_FS.- See Also:
- Constant Field Values
-
ARRAY_FS
static final int ARRAY_FS
The Constant ARRAY_FS.- See Also:
- Constant Field Values
-
STD_FS
static final int STD_FS
The Constant STD_FS.- See Also:
- Constant Field Values
-
DISPLAY_NODE
static final int DISPLAY_NODE
The Constant DISPLAY_NODE.- See Also:
- Constant Field Values
-
BYTE_FS
static final int BYTE_FS
The Constant BYTE_FS.- See Also:
- Constant Field Values
-
BOOL_FS
static final int BOOL_FS
The Constant BOOL_FS.- See Also:
- Constant Field Values
-
SHORT_FS
static final int SHORT_FS
The Constant SHORT_FS.- See Also:
- Constant Field Values
-
LONG_FS
static final int LONG_FS
The Constant LONG_FS.- See Also:
- Constant Field Values
-
DOUBLE_FS
static final int DOUBLE_FS
The Constant DOUBLE_FS.- See Also:
- Constant Field Values
-
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 modelnodeClass
- the node classfsOrString
- the fs or stringintOrLongLikeValue
- the int or long like valuefeat
- 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 modelnodeClass
- the node classfsOrString
- the fs or stringintOrLongLikeValue
- the int or long like valueelementIndex
- 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
-
initChildren
protected void initChildren()
Description copied from class:FSTreeNode
Inits the children.- Specified by:
initChildren
in classFSTreeNode
-
makeNodes
private void makeNodes(java.util.List<FSNode> arrayNodes, int size, java.util.function.IntFunction<FSNode> newFSNode)
Make nodes.- Parameters:
arrayNodes
- the array nodesnewFSNode
- the new FS node
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.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
-
-