Package org.apache.uima.cas.impl
Class ListUtils
java.lang.Object
org.apache.uima.cas.impl.ListUtils
Utilities for dealing with CAS List types.
The many places operations-to-set-values are done to update feature values,
which use the notIndexed form, because
list elements cannot be part of an index key.
Creation methods don't journal, these are guaranteed to be above the line.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
private class
private class
private class
private class
private class
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final CASImpl
private final int
private final int
private ErrorHandler
private final int
private static final AtomicInteger
private final int
private final int
private final int
private final int
private boolean
(package private) final int
private final int
private final int
private final int
private final int
private final int
private final Logger
final int
final int
final int
final int
private int
private final int
private int
private final ListUtils.UpdateFloatActions
private final ListUtils.UpdateFsActions
private final ListUtils.UpdateIntActions
private final ListUtils.UpdateStringActions
-
Constructor Summary
ConstructorsConstructorDescriptionListUtils
(CASImpl aCASImpl, Logger aLogger, ErrorHandler aErrorHandler) Creates a new ListUtils object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
anyListToOutput
(int curNode, XmiSerializationSharedData sharedData, CasSerializerSupport.CasDocSerializer cds, ListUtils.ListOutput out) Go thru a list, calling the ListOutput append method to append strings (to arrays, or string buffers) Stop at the end node, or a null, or a loop (no error reported here)String[]
anyListToStringArray
(int curNode, XmiSerializationSharedData sharedData) anyListToStringList
(int curNode, XmiSerializationSharedData sharedData, CasSerializerSupport.CasDocSerializer cds) int
createFloatList
(List<String> stringValues) int
createFsList
(List<String> stringValues, IntVector fsAddresses) int
createIntList
(List<String> stringValues) int
createStringList
(List<String> stringValues) int[]
fsListToAddressArray
(int curNode) int
getEListType
(int type) int
getHeadFeatCode
(int type) int
getLength
(int type, int addr) int
getLength
(int type, int addr, int neListType, int tailFeat) int
getNeListType
(int type) int
getTailFeatCode
(int type) boolean
isFloatListType
(int type) boolean
isFsListType
(int type) boolean
isIntListType
(int type) boolean
isListType
(int type) boolean
isStringListType
(int type) private void
reportWarning
(String message) private int
updateCommonList
(int addr, List<String> stringValues, ListUtils.UpdateTypeActions actions) int
updateFloatList
(int addr, List<String> stringValues) int
updateFsList
(int addr, List<String> stringValues, IntVector fsAddresses) int
updateIntList
(int addr, List<String> stringValues) int
updateStringList
(int addr, List<String> stringValues)
-
Field Details
-
EMPTY_LIST_STRING
-
errorCount
-
updateIntActions
-
updateFloatActions
-
updateFsActions
-
updateStringActions
-
cas
-
intListType
private final int intListType -
floatListType
private final int floatListType -
stringListType
private final int stringListType -
fsListType
private final int fsListType -
neIntListType
public final int neIntListType -
neFloatListType
public final int neFloatListType -
neStringListType
public final int neStringListType -
neFsListType
public final int neFsListType -
eIntListType
private final int eIntListType -
eFloatListType
private final int eFloatListType -
eStringListType
private final int eStringListType -
eFsListType
private final int eFsListType -
intHeadFeat
private final int intHeadFeat -
intTailFeat
private final int intTailFeat -
floatHeadFeat
private final int floatHeadFeat -
floatTailFeat
private final int floatTailFeat -
stringHeadFeat
private int stringHeadFeat -
stringTailFeat
private int stringTailFeat -
fsHeadFeat
final int fsHeadFeat -
fsTailFeat
private final int fsTailFeat -
logger
-
eh
-
foundCycle
private boolean foundCycle
-
-
Constructor Details
-
ListUtils
Creates a new ListUtils object.- Parameters:
aCASImpl
- the CAS that this ListUtils will operate onaLogger
- optional logger, to receive warning messagesaErrorHandler
- optional SAX ErrorHandler, to receive warning messages
-
-
Method Details
-
getHeadFeatCode
public int getHeadFeatCode(int type) -
getTailFeatCode
public int getTailFeatCode(int type) -
getNeListType
public int getNeListType(int type) -
getEListType
public int getEListType(int type) -
isIntListType
public boolean isIntListType(int type) -
isFloatListType
public boolean isFloatListType(int type) -
isStringListType
public boolean isStringListType(int type) -
isFsListType
public boolean isFsListType(int type) -
isListType
public boolean isListType(int type) -
getLength
public int getLength(int type, int addr) -
getLength
public int getLength(int type, int addr, int neListType, int tailFeat) -
fsListToAddressArray
- Throws:
SAXException
-
createIntList
-
createFloatList
-
createStringList
-
createFsList
-
updateIntList
- Throws:
SAXException
-
updateFloatList
- Throws:
SAXException
-
updateFsList
public int updateFsList(int addr, List<String> stringValues, IntVector fsAddresses) throws SAXException - Throws:
SAXException
-
updateStringList
- Throws:
SAXException
-
updateCommonList
private int updateCommonList(int addr, List<String> stringValues, ListUtils.UpdateTypeActions actions) throws SAXException - Throws:
SAXException
-
reportWarning
- Throws:
SAXException
-