org.apache.uima.fsvars.impl
Class FsVariablesImpl

java.lang.Object
  extended by org.apache.uima.fsvars.impl.FsVariablesImpl
All Implemented Interfaces:
FsVariables

public class FsVariablesImpl
extends java.lang.Object
implements FsVariables

TODO: Create type commment.


Field Summary
 
Fields inherited from interface org.apache.uima.fsvars.FsVariables
INDEX_NAME, NAME_FEATURE_NAME, TYPE_FEATURE_NAME, TYPE_NAME, VALUE_FEATURE_NAME
 
Constructor Summary
FsVariablesImpl()
           
 
Method Summary
 boolean checkCas(org.apache.uima.cas.CAS cas)
          Check a CAS for FsVariable type system and index definition.
 void declareFsVariable(java.lang.String name, org.apache.uima.cas.Type type)
          Declare a new FsVariable.
 org.apache.uima.cas.Type getFsVariableType(java.lang.String name)
          Get the type of an FsVariable.
 org.apache.uima.cas.FeatureStructure getVariableValue(java.lang.String name)
          Get the FeatureStructure value of a variable.
 void init(org.apache.uima.cas.CAS cas)
          Initialize this with current CAS.
 boolean isFsVariable(java.lang.String name)
          Check if a variable of that name exists.
 java.util.List listFsVariables()
          Return a list of all variable names that are currently declared.
 java.util.List listFsVariables(org.apache.uima.cas.Type type)
          Return a list of all variable names of those variables whose type is a subtype of the type parameter.
 void setVariable(java.lang.String name, org.apache.uima.cas.FeatureStructure fs)
          Set the value of an existing variable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FsVariablesImpl

public FsVariablesImpl()
Method Detail

declareFsVariable

public void declareFsVariable(java.lang.String name,
                              org.apache.uima.cas.Type type)
Description copied from interface: FsVariables
Declare a new FsVariable. The variable must not yet exist, or an exception is thrown. Use isFsVariable(String) to check if a variable with the same name already exists.

Specified by:
declareFsVariable in interface FsVariables
Parameters:
name - The name of the variable.
type - The type of the variable.

getFsVariableType

public org.apache.uima.cas.Type getFsVariableType(java.lang.String name)
Description copied from interface: FsVariables
Get the type of an FsVariable.

Specified by:
getFsVariableType in interface FsVariables
Parameters:
name - The name of the variable.
Returns:
The type of the variable, if it exists.

getVariableValue

public org.apache.uima.cas.FeatureStructure getVariableValue(java.lang.String name)
Description copied from interface: FsVariables
Get the FeatureStructure value of a variable.

Specified by:
getVariableValue in interface FsVariables
Parameters:
name - The name of the variable.
Returns:
The FS value of the variable.

isFsVariable

public boolean isFsVariable(java.lang.String name)
Description copied from interface: FsVariables
Check if a variable of that name exists.

Specified by:
isFsVariable in interface FsVariables
Parameters:
name - The name of the variable.
Returns:
true iff a FsVariable of that name exists.

listFsVariables

public java.util.List listFsVariables()
Description copied from interface: FsVariables
Return a list of all variable names that are currently declared.

Specified by:
listFsVariables in interface FsVariables
Returns:
A (sorted) list of strings of all variable names.

listFsVariables

public java.util.List listFsVariables(org.apache.uima.cas.Type type)
Description copied from interface: FsVariables
Return a list of all variable names of those variables whose type is a subtype of the type parameter.

Specified by:
listFsVariables in interface FsVariables
Parameters:
type - The type of variables we want to see.
Returns:
A (sorted) list of strings of variable names.

setVariable

public void setVariable(java.lang.String name,
                        org.apache.uima.cas.FeatureStructure fs)
Description copied from interface: FsVariables
Set the value of an existing variable.

Specified by:
setVariable in interface FsVariables
Parameters:
name - The name of the variable.
fs - The value to set.

init

public void init(org.apache.uima.cas.CAS cas)
Description copied from interface: FsVariables
Initialize this with current CAS. This needs to be called on every process, before any other APIs are called!

Specified by:
init in interface FsVariables
Parameters:
cas - The current CAS.

checkCas

public boolean checkCas(org.apache.uima.cas.CAS cas)
Description copied from interface: FsVariables
Check a CAS for FsVariable type system and index definition. If this return true, init(CAS) will not throw an exception.

Specified by:
checkCas in interface FsVariables
Parameters:
cas - The CAS to check.
Returns:
true iff CAS contains required type and index.


Copyright © 2011. All Rights Reserved.