Package org.apache.uima.tools.cvd
Class FSNode
java.lang.Object
org.apache.uima.tools.cvd.FSTreeNode
org.apache.uima.tools.cvd.FSNode
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
FieldsModifier and TypeFieldDescription(package private) static final int
The Constant ARRAY_FS.private final int
The array elem idx.(package private) static final int
The Constant BOOL_FS.(package private) static final int
The Constant BYTE_FS.(package private) static final int
The Constant DISPLAY_NODE.(package private) static final int
The Constant DOUBLE_FS.private final Feature
The feat.(package private) static final int
The Constant FLOAT_FS.private final TOP
The fs.private final FSTreeModel
The s tree model.(package private) static final int
The Constant INT_FS.private final long
The int or long like value.private final boolean
The is array elem.private boolean
The is shortened string.(package private) static final int
The Constant LONG_FS.private static final int
The Constant maxStringLength.private final int
The node class.(package private) static final int
The Constant SHORT_FS.(package private) static final int
The Constant STD_FS.private final String
The string.(package private) static final int
The Constant STRING_FS.Fields inherited from class org.apache.uima.tools.cvd.FSTreeNode
children
-
Constructor Summary
ConstructorsConstructorDescriptionFSNode
(FSTreeModel fSTreeModel, int nodeClass, Object fsOrString, long intOrLongLikeValue, int elementIndex) Instantiates a new FS node.FSNode
(FSTreeModel fSTreeModel, int nodeClass, Object fsOrString, long intOrLongLikeValue, Feature feat) Instantiates a new FS node. -
Method Summary
Modifier and TypeMethodDescriptionprivate static final String
Escape lt.(package private) int
Gets the array pos.int
getEnd()
Gets the end.private String
Gets the feature string.(package private) String
(package private) int
Gets the node class.private String
Gets the null string.int
getStart()
Gets the start.(package private) TypeImpl
getType()
Gets the type.private String
Gets the value string.protected void
Inits the children.boolean
Checks if is annotation.(package private) boolean
Checks if is shortened string.private int
k2nc
(SlotKinds.SlotKind kind) K 2 nc.private void
makeNodes
(List<FSNode> arrayNodes, int size, IntFunction<FSNode> newFSNode) Make nodes.private static final String
Shorten string.toString()
Methods inherited from class org.apache.uima.tools.cvd.FSTreeNode
getChildCount, getChildren, removeAllChildren, setChildren
-
Field Details
-
maxStringLength
private static final int maxStringLengthThe Constant maxStringLength.- See Also:
-
fSTreeModel
The s tree model. -
INT_FS
static final int INT_FSThe Constant INT_FS.- See Also:
-
FLOAT_FS
static final int FLOAT_FSThe Constant FLOAT_FS.- See Also:
-
STRING_FS
static final int STRING_FSThe Constant STRING_FS.- See Also:
-
ARRAY_FS
static final int ARRAY_FSThe Constant ARRAY_FS.- See Also:
-
STD_FS
static final int STD_FSThe Constant STD_FS.- See Also:
-
DISPLAY_NODE
static final int DISPLAY_NODEThe Constant DISPLAY_NODE.- See Also:
-
BYTE_FS
static final int BYTE_FSThe Constant BYTE_FS.- See Also:
-
BOOL_FS
static final int BOOL_FSThe Constant BOOL_FS.- See Also:
-
SHORT_FS
static final int SHORT_FSThe Constant SHORT_FS.- See Also:
-
LONG_FS
static final int LONG_FSThe Constant LONG_FS.- See Also:
-
DOUBLE_FS
static final int DOUBLE_FSThe Constant DOUBLE_FS.- See Also:
-
nodeClass
private final int nodeClassThe node class. -
intOrLongLikeValue
private final long intOrLongLikeValueThe int or long like value. -
fs
The fs. -
string
The string. -
feat
The feat. -
arrayElemIdx
private final int arrayElemIdxThe array elem idx. -
isArrayElem
private final boolean isArrayElemThe is array elem. -
isShortenedString
private boolean isShortenedStringThe is shortened string.
-
-
Constructor Details
-
FSNode
FSNode(FSTreeModel fSTreeModel, int nodeClass, 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, 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 Details
-
k2nc
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
Make nodes.- Parameters:
arrayNodes
- the array nodesnewFSNode
- the new FS node
-
toString
-
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
String getFullString()- Returns:
- for string nodes, return the string value (so it can be displayed seperately
-
getValueString
Gets the value string.- Returns:
- the value string
-
shortenString
Shorten string.- Parameters:
s
- the s- Returns:
- the string
-
escapeLt
Escape lt.- Parameters:
s
- the s- Returns:
- the 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
-