org.apache.uima.cas
Interface FeatureValuePath


Deprecated. use FeaturePath

@Deprecated
public interface FeatureValuePath

Contains 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:

Handling of Arrays
For array-valued features, the following access operators are defined: If the feature path is defined directly for an 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
  1. 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.
  2. At typeSystemInit of your component (CAS consumer or TAE), call typeSystemInit of the feature path.
  3. Call getValueType to find out whether the feature path evaluates to a String, and int, a float, or their array counterparts.
  4. Depending on the leaf type, call the appropriate evaluateAs methods


Method Summary
 java.lang.Object evaluate(int currentFS, org.apache.uima.cas.impl.LowLevelCAS cas)
          Deprecated.  
 java.lang.Float evaluateAsFloat(int currentFS, org.apache.uima.cas.impl.LowLevelCAS cas)
          Deprecated.  
 java.lang.Float[] evaluateAsFloatArray(int currentFS, org.apache.uima.cas.impl.LowLevelCAS cas)
          Deprecated.  
 java.lang.Integer evaluateAsInt(int currentFS, org.apache.uima.cas.impl.LowLevelCAS cas)
          Deprecated.  
 java.lang.Integer[] evaluateAsIntArray(int currentFS, org.apache.uima.cas.impl.LowLevelCAS cas)
          Deprecated.  
 java.lang.String evaluateAsString(int currentFS, org.apache.uima.cas.impl.LowLevelCAS cas)
          Deprecated. Evaluates each snippet of the feature path.
 java.lang.String[] evaluateAsStringArray(int currentFS, org.apache.uima.cas.impl.LowLevelCAS cas)
          Deprecated.  
 int getFSType()
          Deprecated. Returns the type for which the last feature in the feature path is defined.
 java.lang.String getValueType()
          Deprecated. Returns the type that this feature path will evaluate to.
 void typeSystemInit(int fsType, org.apache.uima.cas.impl.LowLevelTypeSystem ts)
          Deprecated.  
 

Method Detail

evaluate

java.lang.Object evaluate(int currentFS,
                          org.apache.uima.cas.impl.LowLevelCAS cas)
Deprecated. 

evaluateAsFloat

java.lang.Float evaluateAsFloat(int currentFS,
                                org.apache.uima.cas.impl.LowLevelCAS cas)
Deprecated. 

evaluateAsFloatArray

java.lang.Float[] evaluateAsFloatArray(int currentFS,
                                       org.apache.uima.cas.impl.LowLevelCAS cas)
Deprecated. 

evaluateAsInt

java.lang.Integer evaluateAsInt(int currentFS,
                                org.apache.uima.cas.impl.LowLevelCAS cas)
Deprecated. 

evaluateAsIntArray

java.lang.Integer[] evaluateAsIntArray(int currentFS,
                                       org.apache.uima.cas.impl.LowLevelCAS cas)
Deprecated. 

evaluateAsString

java.lang.String evaluateAsString(int currentFS,
                                  org.apache.uima.cas.impl.LowLevelCAS cas)
Deprecated. 
Evaluates each snippet of the feature path. Returns a String representation of the leaf value of the path. Returns null if some feature within the path is not set. If the leaf snippet is COVERED_TEXT, returns the covered text of currentFS.

Parameters:
currentFS -
cas -
Returns:
A string representation of the leaf value.

evaluateAsStringArray

java.lang.String[] evaluateAsStringArray(int currentFS,
                                         org.apache.uima.cas.impl.LowLevelCAS cas)
Deprecated. 

getFSType

int getFSType()
Deprecated. 
Returns the type for which the last feature in the feature path is defined. Assumes that typeSystemInit has been called prior to this method.

Returns:
int the type for which the last feature in the feature path is defined.

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,
                    org.apache.uima.cas.impl.LowLevelTypeSystem ts)
                    throws CASRuntimeException
Deprecated. 
Throws:
CASRuntimeException


Copyright © 2006–2014 The Apache Software Foundation. All rights reserved.