Package org.apache.uima.cas
Interface FeatureValuePath
-
- All Known Implementing Classes:
FeatureValuePathImpl
@Deprecated public interface FeatureValuePathDeprecated.useFeaturePathContains CAS Type and Feature objects to represent a feature path of the form feature1/.../featureN. Each part that is enclosed within / is referred to as "path snippet" below. Also contains the necessary evaluation logic to yield the value of the feature path. For leaf snippets, the following "special features" are defined:coveredText()can be accessed usingevaluateAsStringtypeName()can be accessed usingevaluateAsStringfsId()can be accessed usingevaluateAsInt. Its result can be used to retrieve an FS from the current LowLevel-CAS.uniqueId()can be accessed usingevaluateAsInt. Its result can be used to uniquely identify an FS for a document (even if the document is split over several CAS chunks)
- A feature path may contain 0 or more features of type
FSArray, but not as the last path snippet. The next path snippet must contain the fully qualified type name, example:family/members[0]/somepackage.Person:name - A feature path may also contain 0 or 1 feature of type
IntArray, StringArray, FloatArray, but only as the last path snippet.
[index]returns the array entry atindex[last]returns the last entry of the array[]returns an array of values.[]is only allowed 0 or 1 time in a feature path. If it is used,getValueTypewill return one of the following:CAS.TYPE_NAME_STRING_ARRAY ,CAS.TYPE_NAME_INTEGER_ARRAY,CAS.TYPE_NAME_FLOAT_ARRAY.
FSArray, an actual feature name can be omitted, and only the array access operator can be used. Examples:[]/somepackage.Person:coveredText() [last]/somepackage.Person:fsId()If the feature path is defined directly, for a String, integer or float array, the array access operator can be used directly. Unlike FSArray, this access operator must be the only entry in the path.
Usage- To create the feature path, use
FeaturePath.getFeaturePath. Note that the client code needs to keep track of the "start type" of the feature path, that is, the type that contains the attribute used in the first snippet of the path. - At
typeSystemInitof your component (CAS consumer or TAE), calltypeSystemInitof the feature path. - Call
getValueTypeto find out whether the feature path evaluates to a String, and int, a float, or their array counterparts. - Depending on the leaf type, call the appropriate
evaluateAsmethods
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description java.lang.Objectevaluate(int currentFS, LowLevelCAS cas)Deprecated.java.lang.FloatevaluateAsFloat(int currentFS, LowLevelCAS cas)Deprecated.java.lang.Float[]evaluateAsFloatArray(int currentFS, LowLevelCAS cas)Deprecated.java.lang.IntegerevaluateAsInt(int currentFS, LowLevelCAS cas)Deprecated.java.lang.Integer[]evaluateAsIntArray(int currentFS, LowLevelCAS cas)Deprecated.java.lang.StringevaluateAsString(int currentFS, LowLevelCAS cas)Deprecated.Evaluates each snippet of the feature path.java.lang.String[]evaluateAsStringArray(int currentFS, LowLevelCAS cas)Deprecated.intgetFSType()Deprecated.Returns the type for which the last feature in the feature path is defined.java.lang.StringgetValueType()Deprecated.Returns the type that this feature path will evaluate to.voidtypeSystemInit(int fsType, LowLevelTypeSystem ts)Deprecated.
-
-
-
Method Detail
-
evaluate
java.lang.Object evaluate(int currentFS, LowLevelCAS cas)Deprecated.
-
evaluateAsFloat
java.lang.Float evaluateAsFloat(int currentFS, LowLevelCAS cas)Deprecated.
-
evaluateAsFloatArray
java.lang.Float[] evaluateAsFloatArray(int currentFS, LowLevelCAS cas)Deprecated.
-
evaluateAsInt
java.lang.Integer evaluateAsInt(int currentFS, LowLevelCAS cas)Deprecated.
-
evaluateAsIntArray
java.lang.Integer[] evaluateAsIntArray(int currentFS, LowLevelCAS cas)Deprecated.
-
evaluateAsString
java.lang.String evaluateAsString(int currentFS, LowLevelCAS cas)Deprecated.Evaluates each snippet of the feature path. Returns a String representation of the leaf value of the path. Returnsnullif some feature within the path is not set. If the leaf snippet isCOVERED_TEXT, returns the covered text ofcurrentFS.- Parameters:
currentFS- -cas- -- Returns:
- A string representation of the leaf value.
-
evaluateAsStringArray
java.lang.String[] evaluateAsStringArray(int currentFS, LowLevelCAS cas)Deprecated.
-
getFSType
int getFSType()
Deprecated.Returns the type for which the last feature in the feature path is defined. Assumes thattypeSystemInithas been called prior to this method.- For a feature path
feature1/.../featureN-1/featureN, returns the type of featureN. - For a feature path
feature1/.../featureN-1/typeN:featureN, returns the type code for typeN. (For example, if the range type of featureN-1 is FSList or FSArray) - For a feature path
feature1, where feature1 is simple-valued, returns the type that was used intypeSystemInit
- Returns:
- int the type for which the last feature in the feature path is defined.
- For a feature path
-
getValueType
java.lang.String getValueType()
Deprecated.Returns the type that this feature path will evaluate to. Can be used to select the correct "evaluateAs" method.- Returns:
- String the type that this feature path will evaluate to. Will be one of the following:
- CAS.TYPE_NAME_STRING
- CAS.TYPE_NAME_STRING_ARRAY
- CAS.TYPE_NAME_INTEGER
- CAS.TYPE_NAME_INTEGER_ARRAY
- CAS.TYPE_NAME_FLOAT
- CAS.TYPE_NAME_FLOAT_ARRAY
-
typeSystemInit
void typeSystemInit(int fsType, LowLevelTypeSystem ts) throws CASRuntimeExceptionDeprecated.- Throws:
CASRuntimeException
-
-