Package org.apache.uima.cas_data
Interface FeatureStructure
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
PrimitiveArrayFS
,ReferenceArrayFS
- All Known Implementing Classes:
FeatureStructureImpl
,PrimitiveArrayFSImpl
,ReferenceArrayFSImpl
An object in the CAS. Each FeatureStructure has an optional ID, a type (represented as a string),
and a collection of features, which are attribute-value pairs. Feature names are strings, and
their values may be primitives (String, integer, float) or references (via ID) to another
FeatureStructures. Circular references are allowed.
Arrays are represented by the subtypes PrimitiveArrayFS
and ReferenceArrayFS
.
Arrays are not primitive values. This means that if the value of a feature is conceptually, for
example, an integer array, this will be represented in the CasData as a reference, via ID, to a
PrimitiveArrayFS object that actually contains the integer array value.
FeatureStructures also have a property indexed
, which determines whether the
FeatureStructure should be added to the CAS's indexes if the CAS Data is converted to a CAS
Object. The CasData itself does not provide indexes.
-
Method Summary
Modifier and TypeMethodDescriptionString[]
Gets the names of all features on this FeatureStructure.getFeatureValue
(String aName) Gets the value of a featuregetId()
Gets the ID of this FeatureStructure.int[]
Gets the index repositories that this FeatureStrucutre should be indexed in if the CasData is converted to a CAS Object.getType()
Gets the type of this FeatureStructureboolean
Deprecated.void
setFeatureValue
(String aName, FeatureValue aValue) Sets the value of a featurevoid
Sets the ID of this FeatureStructure.void
setIndexed
(boolean aIndexed) Deprecated.UsesetIndexed(int[])
insteadvoid
setIndexed
(int[] aIndexed) Sets the index repositories that this FeatureStrucutre should be indexed in if the CasData is converted to a CAS Object.void
Sets the type of this FeatureStructure
-
Method Details
-
getId
String getId()Gets the ID of this FeatureStructure. IDs are optional, so this may return null. A FeatureStructure must have an ID if it is to be the target of a reference.- Returns:
- this FeatureStructure's ID, null if none
-
setId
Sets the ID of this FeatureStructure. IDs are optional, so null may be passed to this method. A FeatureStructure must have an ID if it is to be the target of a reference.- Parameters:
aId
- the ID to assign to this FeatureStructure, null if none. It is the caller's responsibiltiy to ensure that this ID is unique within the CasData containing this FeatureStructure.
-
getType
String getType()Gets the type of this FeatureStructure- Returns:
- this FeatureStructure's type, as a string
-
setType
Sets the type of this FeatureStructure- Parameters:
aType
- this FeatureStructure's type, as a string
-
getFeatureNames
String[] getFeatureNames()Gets the names of all features on this FeatureStructure.- Returns:
- an array of feature names
-
getFeatureValue
Gets the value of a feature- Parameters:
aName
- name of feature- Returns:
- value of feature named
aName
, or null if there is no such feature
-
setFeatureValue
Sets the value of a feature- Parameters:
aName
- name of feature to setaValue
- value of feature
-
isIndexed
Deprecated.UsegetIndexed()
insteadGets whether this FeatureStructure should be indexed if the CasData is converted to a CAS Object. The CasData itself does not provide indexes.- Returns:
- true if this FS should be indexed, false if not
-
setIndexed
Deprecated.UsesetIndexed(int[])
insteadSets whether this FeatureStructure should be indexed if the CasData is converted to a CAS Object. The CasData itself does not provide indexes.- Parameters:
aIndexed
- true if this FS should be indexed, false if not
-
getIndexed
int[] getIndexed()Gets the index repositories that this FeatureStrucutre should be indexed in if the CasData is converted to a CAS Object. The CasData itself does not provide indexes.- Returns:
- an array containing the numbers of the index repsositories that should contain this FS. Returns an empty array if this FS is not indexed.
-
setIndexed
void setIndexed(int[] aIndexed) Sets the index repositories that this FeatureStrucutre should be indexed in if the CasData is converted to a CAS Object. The CasData itself does not provide indexes.- Parameters:
aIndexed
- an array containing the numbers of the index repsositories that should contain this FS. Passing null is equivalent to passing an empty array.
-
getIndexed()
instead