Inherited by uima::FloatListFS, uima::IntListFS, uima::ListFS, and uima::StringListFS.
(e.g. they are of type empty list or of type non-empty list). An element can be either a FeatureStructure or a float or an int or a string. For each such element type there is a sub-class of BasicListFS implementing this template interface with type specific methods. ListFS, IntListFS, FloatListFS, StringListFS.
All get methods may throw an InvalidFSObjectException
if the feature structure object is not valid.
Creating a list can be done like this:
// store elements of a vector of strings in a list feature FeatureStructure fsNewString; // re-used for each new string StringListFS fsNewList = tcas.createListFS(); // create an empty list // build up a fs list from our vector for (size_t i = 0; i < vecStrings.size(); ++i) { // create a string feature structure fsNewList.addLast(vecStrings[i]); } // now that the list is complete, set the feature value to the list fsWithListFeature.setFSValue(fListFeature, fsNewList);
// check if we need to touch our element if (fsWithListFeature.hasListElements(fListFeature) ) { // get list StringListFS fsList = fsWithListFeature.getStringListFSValue(fListFeature); // iterate list while (!fsList.isEmpty()) { cout << fsList.getHead() << " "; // print the string fsList.moveToNext(); } }
The example uses StringListFS to show the usage of the interfaces with strings. Usage of FeatureStructure, int or float values is analogous.
Public Types | |
typedef T | HeadType |
internal | |
typedef lowlevel::TyHeapCell | TyArrayElement |
Public Member Functions | |
BasicListFS () | |
Default CTOR: Creates an invalid BasicListFS (use CAS::createListFS() instead). | |
BasicListFS (FeatureStructure const &fs) | |
Upgrade/Conversion CTOR: Creates an BasicListFS from an existing FeatureStructure. | |
bool | isEmpty () const |
Return true if this element is not valid or of type empty list. | |
T | getHead () const |
Get the value of the head feature of this list element. | |
void | setHead (T const &fs) |
Set the value of the head feature of this list element. | |
BasicListFS | getTail () const |
Get the value of the tail feature of this list element. | |
void | setTail (BasicListFS fs) |
Set the value of the tail feature of this list element. | |
size_t | getLength () const |
Get the length of this list. | |
BasicListFS | addFirst (T const &fs) |
Adds the value fs to the begin of this list. | |
BasicListFS | addLast (T const &fs) |
Adds the value fs to the end of this list. | |
BasicListFS | append (BasicListFS l) |
Appends the list l to the end of this list. | |
BasicListFS | prepend (BasicListFS l) |
Appends the list l to the begin of this list. | |
void | moveToNext () |
Advance this list element to the next element in the list. | |
BasicListFS | removeElement (T const &element) |
Removes the first occurrence of element from this list. | |
CAS & | getCAS () |
Returns the CAS object in which this feature structure lives. | |
CAS const & | getCAS () const |
bool | isValid () const |
Check if this FS object is valid, i.e., properly initialized. | |
Type | getType () const |
FeatureStructure | clone () |
Creates a copy of this feature structure. | |
FeatureStructure | clone (Type const &t) |
creates a feature structure of type t and copies all "common" features of t and this->getType(). | |
bool | isUntouchedFSValue (Feature const &crFeature) const |
Check if the value of crFeature was already used via a call to getFSValue() or setFSValue() . | |
FeatureStructure | getFSValue (Feature const &crFeature) const |
Get the value of feature crFeature of this feature structure (must not be a builtin type). | |
FeatureStructure | getFeatureValue (Feature const &crFeature) const |
Get the value of feature crFeature of this feature structure (must not be a builtin type). | |
void | setFSValue (Feature const &crFeature, FeatureStructure const &anFS) |
set the value of feature crFeature of this feature structure (must not be a builtin type). | |
void | setFeatureValue (Feature const &crFeature, FeatureStructure const &anFS) |
set the value of feature crFeature of this feature structure (must not be a builtin type). | |
int | getIntValue (Feature const &crFeature) const |
Get the value of feature crFeature , must be builtin type integer. | |
void | setIntValue (Feature const &crFeature, int i) |
Set the value of feature crFeature , must be builtin type integer. | |
float | getFloatValue (Feature const &crFeature) const |
Get the value of feature crFeature , must be builtin type float. | |
void | setFloatValue (Feature const &crFeature, float) |
Set the value of feature crFeature , must be builtin type float. | |
UnicodeStringRef | getStringValue (Feature const &crFeature) const |
Get the value of feature crFeature , must be of type string. | |
void | setStringValue (Feature const &crFeature, UnicodeStringRef cuStr) |
sets the value of feature crFeature of this feature structure to a new string on the heap. | |
void | setStringValue (Feature const &crFeature, UChar const *cuStr, size_t uiLen) |
void | setStringValue (Feature const &crFeature, icu::UnicodeString const &crustr) |
void | setStringValueExternal (Feature const &crFeature, UnicodeStringRef cuStr) |
sets the value of feature crFeature of this feature structure to a new string outside of the heap. | |
void | setStringValueExternal (Feature const &crFeature, UChar const *cuStr, size_t uiLen) |
void | setStringValueExternal (Feature const &crFeature, icu::UnicodeString const &crustr) |
ArrayFS | getArrayFSValue (Feature const &fArray) const |
Return feature structure of type array stored at feature fArray. | |
FloatArrayFS | getFloatArrayFSValue (Feature const &fArray) const |
Return feature structure of type array stored at feature fArray. | |
IntArrayFS | getIntArrayFSValue (Feature const &fArray) const |
Return feature structure of type array stored at feature fArray. | |
StringArrayFS | getStringArrayFSValue (Feature const &fArray) const |
Return feature structure of type array stored at feature fArray. | |
bool | hasListElements (Feature const &fList) const |
Returns true if the list stored at feature fList has elements. | |
ListFS | getListFSValue (Feature const &fList) const |
Return feature structure of type list stored at feature fList. | |
FloatListFS | getFloatListFSValue (Feature const &f) const |
Return feature structure of type list stored at feature fList. | |
IntListFS | getIntListFSValue (Feature const &f) const |
Return feature structure of type list stored at feature fList. | |
StringListFS | getStringListFSValue (Feature const &f) const |
Return feature structure of type list stored at feature fList. | |
bool | getBooleanValue (Feature const &crFeature) const |
Get the value of feature crFeature , must be builtin type byte. | |
void | setBooleanValue (Feature const &crFeature, bool) |
Set the value of feature crFeature , must be builtin type byte. | |
char | getByteValue (Feature const &crFeature) const |
Get the value of feature crFeature , must be builtin type byte. | |
void | setByteValue (Feature const &crFeature, char) |
Set the value of feature crFeature , must be builtin type byte. | |
short | getShortValue (Feature const &crFeature) const |
Get the value of feature crFeature , must be builtin type short. | |
void | setShortValue (Feature const &crFeature, short) |
Set the value of feature crFeature , must be builtin type short. | |
INT64 | getLongValue (Feature const &crFeature) const |
Get the value of feature crFeature , must be builtin type short. | |
void | setLongValue (Feature const &crFeature, INT64) |
Set the value of feature crFeature , must be builtin type short. | |
void | setDoubleValue (Feature const &crFeature, double) |
Set the value of feature crFeature , must be builtin type short. | |
double | getDoubleValue (Feature const &crFeature) const |
Get the value of feature crFeature , must be builtin type short. | |
BooleanArrayFS | getBooleanArrayFSValue (Feature const &fArray) const |
Return feature structure of type array stored at feature fArray. | |
ByteArrayFS | getByteArrayFSValue (Feature const &fArray) const |
Return feature structure of type array stored at feature fArray. | |
ShortArrayFS | getShortArrayFSValue (Feature const &fArray) const |
Return feature structure of type array stored at feature fArray. | |
LongArrayFS | getLongArrayFSValue (Feature const &fArray) const |
Return feature structure of type array stored at feature fArray. | |
DoubleArrayFS | getDoubleArrayFSValue (Feature const &fArray) const |
Return feature structure of type array stored at feature fArray. | |
bool | operator== (FeatureStructure const &) const |
bool | operator!= (FeatureStructure const &crFS) const |
bool | operator< (FeatureStructure const &crFS) const |
Protected Member Functions | |
void | checkValidity (TyMessageId) const |
void | checkFeature (Feature const &f, TyMessageId) const |
void | checkNonBuiltinFeature (Feature const &f, TyMessageId) const |
void | checkAppropFeature (Feature const &f, lowlevel::TyFSType aType, TyMessageId) const |
void | checkAppropFeature (Feature const &f, FeatureStructure const &anFS, TyMessageId) const |
void | checkRangeIsString (Feature const &fList, TyMessageId) const |
Protected Attributes | |
lowlevel::TyFS | iv_tyFS |
CAS * | iv_cas |
|
internal
|
|
|
|
Default CTOR: Creates an invalid BasicListFS (use CAS::createListFS() instead).
|
|
Upgrade/Conversion CTOR: Creates an BasicListFS from an existing FeatureStructure. fs must be of type List.
|
|
Return true if this element is not valid or of type empty list.
|
|
Get the value of the head feature of this list element.
|
|
Set the value of the head feature of this list element.
|
|
Get the value of the tail feature of this list element.
|
|
Set the value of the tail feature of this list element.
|
|
Get the length of this list.
|
|
Adds the value fs to the begin of this list. addFirst takes constant time with the length of this list
|
|
Adds the value fs to the end of this list. addLast takes linear time with the length of this list
|
|
Appends the list l to the end of this list. append takes linear time with the length of this list
|
|
Appends the list l to the begin of this list.
prepend takes linear time with the length of list
|
|
Advance this list element to the next element in the list.
Equivalent to
|
|
Removes the first occurrence of element from this list.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns the CAS object in which this feature structure lives.
Reimplemented in uima::AnnotationFS. |
|
Reimplemented in uima::AnnotationFS. |
|
Check if this FS object is valid, i.e., properly initialized.
|
|
|
|
Creates a copy of this feature structure. The returned feature structure is a new and separate object but all features of the feature structure which are not of builtin types (integer, float, string) will be shared between the clone and it's source FS.
|
|
creates a feature structure of type t and copies all "common" features of t and this->getType(). A feature is common to two types t1 and t2 if it is defined on the most specific common supertype of t1 and t2. |
|
Check if the value of
|
|
Get the value of feature
|
|
Get the value of feature
|
|
set the value of feature
|
|
set the value of feature
|
|
Get the value of feature
|
|
Set the value of feature
|
|
Get the value of feature
|
|
Set the value of feature
|
|
Get the value of feature
|
|
sets the value of feature
Precondition: getFSValue(crFeature) must be of type string. The string is copied to the heap and the string value will point to the copy on the heap and not to
|
|
|
|
|
|
sets the value of feature
Precondition: FS must be of type string. The string is not copied to the heap, so the string value will point to
|
|
|
|
|
|
Return feature structure of type array stored at feature fArray. The return value is guaranteed to be a properly terminated array. Each element in the array is a FeatureStructure.
|
|
Return feature structure of type array stored at feature fArray. The return value is guaranteed to be a properly terminated array. Each element in the array is a float.
|
|
Return feature structure of type array stored at feature fArray. The return value is guaranteed to be a properly terminated array. Each element in the array is a int.
|
|
Return feature structure of type array stored at feature fArray. The return value is guaranteed to be a properly terminated array. Each element in the array is a string.
|
|
Returns true if the list stored at feature fList has elements.
|
|
Return feature structure of type list stored at feature fList. The return value is guaranteed to be a properly terminated list. Each element of the list is a feature structure.
|
|
Return feature structure of type list stored at feature fList. The return value is guaranteed to be a properly terminated list. Each element of the list is a float.
|
|
Return feature structure of type list stored at feature fList. The return value is guaranteed to be a properly terminated list. Each element of the list is a int.
|
|
Return feature structure of type list stored at feature fList. The return value is guaranteed to be a properly terminated list. Each element of the list is a string.
|
|
Get the value of feature
|
|
Set the value of feature
|
|
Get the value of feature
|
|
Set the value of feature
|
|
Get the value of feature
|
|
Set the value of feature
|
|
Get the value of feature
|
|
Set the value of feature
|
|
Set the value of feature
|
|
Get the value of feature
|
|
Return feature structure of type array stored at feature fArray. The return value is guaranteed to be a properly terminated array. Each element in the array is a byte.
|
|
Return feature structure of type array stored at feature fArray. The return value is guaranteed to be a properly terminated array. Each element in the array is a byte.
|
|
Return feature structure of type array stored at feature fArray. The return value is guaranteed to be a properly terminated array. Each element in the array is a short.
|
|
Return feature structure of type array stored at feature fArray. The return value is guaranteed to be a properly terminated array. Each element in the array is a lomg (INT64).
|
|
Return feature structure of type array stored at feature fArray. The return value is guaranteed to be a properly terminated array. Each element in the array is a double (INT64).
|
|
|
|
|
|
|
|
|
|
|