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 intARRAY_FSThe Constant ARRAY_FS.private intarrayElemIdxThe array elem idx.(package private) static intBOOL_FSThe Constant BOOL_FS.(package private) static intBYTE_FSThe Constant BYTE_FS.(package private) static intDISPLAY_NODEThe Constant DISPLAY_NODE.(package private) static intDOUBLE_FSThe Constant DOUBLE_FS.private FeaturefeatThe feat.(package private) static intFLOAT_FSThe Constant FLOAT_FS.private TOPfsThe fs.private FSTreeModelfSTreeModelThe s tree model.(package private) static intINT_FSThe Constant INT_FS.private longintOrLongLikeValueThe int or long like value.private booleanisArrayElemThe is array elem.private booleanisShortenedStringThe is shortened string.(package private) static intLONG_FSThe Constant LONG_FS.private static intmaxStringLengthThe Constant maxStringLength.private intnodeClassThe node class.(package private) static intSHORT_FSThe Constant SHORT_FS.(package private) static intSTD_FSThe Constant STD_FS.private java.lang.StringstringThe string.(package private) static intSTRING_FSThe 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.StringescapeLt(java.lang.String s)Escape lt.(package private) intgetArrayPos()Gets the array pos.intgetEnd()Gets the end.private java.lang.StringgetFeatureString()Gets the feature string.(package private) java.lang.StringgetFullString()(package private) intgetNodeClass()Gets the node class.private java.lang.StringgetNullString()Gets the null string.intgetStart()Gets the start.(package private) TypeImplgetType()Gets the type.private java.lang.StringgetValueString()Gets the value string.protected voidinitChildren()Inits the children.booleanisAnnotation()Checks if is annotation.(package private) booleanisShortenedString()Checks if is shortened string.private intk2nc(SlotKinds.SlotKind kind)K 2 nc.private voidmakeNodes(java.util.List<FSNode> arrayNodes, int size, java.util.function.IntFunction<FSNode> newFSNode)Make nodes.private static java.lang.StringshortenString(java.lang.String s)Shorten string.java.lang.StringtoString()-
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:FSTreeNodeInits the children.- Specified by:
initChildrenin 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:
toStringin 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
-
-