Package org.apache.uima.jcas.cas
Interface CommonList
- All Superinterfaces:
Cloneable,FeatureStructure
- All Known Subinterfaces:
NonEmptyList
- All Known Implementing Classes:
EmptyFloatList,EmptyFSList,EmptyIntegerList,EmptyStringList,FloatList,FSList,IntegerList,NonEmptyFloatList,NonEmptyFSList,NonEmptyIntegerList,NonEmptyStringList,StringList
This class is the super class of list nodes (both empty and non empty)
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault voidanyListToOutput(XmiSerializationSharedData sharedData, CasSerializerSupport.CasDocSerializer cds, Consumer<String> out) Internal Use.anyListToStringList(XmiSerializationSharedData sharedData, CasSerializerSupport.CasDocSerializer cds) Internal useCreates a non empty nodedefault StringInternal use overridden in nonempty nodes Return the head value of a list as a string suitable for serialization.default CommonListdefault impl for empty and nonempty listsdefault intlength of a list, handling list loops.default CommonListgetNonEmptyNthNode(int i) Like GetNthNode, but throws exception if emptydefault CommonListgetNthNode(int i) Get the nth node.default CommonListinsert a new nonempty node following this nodedefault booleanisEmpty()default CommonListpushNode()Creates a new node and pushes it onto the front of the existing nodedefault voidInternal use overridden in nonempty nodes used when deserializingdefault voidsets the tail of this nodedefault voidwalkList(Consumer<NonEmptyList> consumer, Runnable foundLoop) Walks a list, executing the consumer on each element.default voidwalkList_saxException(org.apache.uima.internal.util.function.Consumer_withSaxException<NonEmptyList> consumer, Runnable foundLoop) Walks a list, executing the consumer on each element.Methods inherited from interface org.apache.uima.cas.FeatureStructure
_getTypeCode, _id, clone, equals, getAddress, getBooleanValue, getByteValue, getCAS, getDoubleValue, getFeatureValue, getFeatureValueAsString, getFloatValue, getIntValue, getJCas, getLongValue, getShortValue, getStringValue, getType, hashCode, setBooleanValue, setByteValue, setDoubleValue, setFeatureValue, setFeatureValueFromString, setFloatValue, setIntValue, setLongValue, setShortValue, setStringValue
-
Field Details
-
_FeatName_head
- See Also:
-
_FeatName_tail
- See Also:
-
EMPTY_LIST_STRING
-
-
Method Details
-
getNthNode
Get the nth node.- Parameters:
i- -- Returns:
- the nth node, which may be an "empty" node
-
getNonEmptyNthNode
Like GetNthNode, but throws exception if empty- Parameters:
i- -- Returns:
- -
-
getLength
default int getLength()length of a list, handling list loops. returns the number of unique nodes in the list- Returns:
- the number of items in the list
-
walkList_saxException
default void walkList_saxException(org.apache.uima.internal.util.function.Consumer_withSaxException<NonEmptyList> consumer, Runnable foundLoop) throws SAXException Walks a list, executing the consumer on each element. If a loop is found, the foundloop method is run.- Parameters:
consumer- a Consumer with Sax ExceptionfoundLoop- run if a loop happens- Throws:
SAXException- -
-
walkList
Walks a list, executing the consumer on each element. If a loop is found, the foundloop method is run.- Parameters:
consumer- a Consumer (with no declared exceptions)foundLoop- run if a loop happens
-
createNonEmptyNode
CommonList createNonEmptyNode()Creates a non empty node- Returns:
- a new non empty node
-
emptyList
CommonList emptyList()- Returns:
- a shared instance of the empty node.
-
get_headAsString
Internal use overridden in nonempty nodes Return the head value of a list as a string suitable for serialization. For FeatureStructure values, return the _id.- Returns:
- value suitable for serialization
-
set_headFromString
Internal use overridden in nonempty nodes used when deserializing- Parameters:
v- value to set, as a string
-
insertNode
insert a new nonempty node following this node- Returns:
- the new node
-
pushNode
Creates a new node and pushes it onto the front of the existing node- Returns:
- the new node
-
getCommonTail
default impl for empty and nonempty lists- Returns:
- - instance of CommonList This has to be named differently from getTail, otherwise the "default" method in the interface appears as declared method in reflection named getTail which conflicts with the one returning a specific typed value
-
setTail
sets the tail of this node- Parameters:
v- the tail
-
isEmpty
default boolean isEmpty()- Returns:
- true if this object represents an empty list
-