|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SimplePrecondition
SimplePrecondition
defines a few simple conditions that can be evaluted against a
CAS
.
A value in the CAS (see below) will be compared against the precondition's
comparisonValue
property using the speicified
predicate
.
The value in the CAS is specified by providing values for
indexName
,
fsMatchConstraint
, and
featureName
. If any FeatureStructure in the specified index
matches the FS match constraint and has a feature value that satisfies this precondition's
precicate, the precondition will be considered satisfied. If the index name is ommitted, the
default Annotation index (if present) will be used.
The possible predicates are defined by constants on this interface. The currently avaialble predicates are:
EQUAL
- evaluates to true if and only if the values are equal (according to
the equality rules of their data type).ELEMENT_OF
- the comparison value must be an array. Evaluates to true if and
only if the test value is equal to one of the elements of the comparison array.LANGUAGE_SUBSUMED
- the comparison value must be an array of Strings, each of
which is an ISO language identifier. Evaluates to true if and only if the test value is an ISO
language identifier that is subsumed by one of the values of the comparison array. (For example,
"en_US" is subsumed by "en.")MetaDataObject
s, a SimplePrecondition
may or may not be
modifiable. An application can find out by calling the MetaDataObject.isModifiable()
method.
Field Summary | |
---|---|
static String |
ELEMENT_OF
Identifies the ELEMENT_OF predicate. |
static String |
EQUAL
Identifies the EQUAL predicate. |
static String |
LANGUAGE_SUBSUMED
Identifies the LANGUAGE_SUBSUMED predicate. |
static String |
PRECONDITION_TYPE
The type identifier for this class of precondition. |
Method Summary | |
---|---|
Object |
getComparisonValue()
Retrieves the literal value to which features' values will be compared. |
boolean |
getDefault()
Retrieves the deafult value for this precondition. |
String |
getFeatureName()
Gets the name of the feature to be tested. |
String |
getFsIndexName()
Retrieves the name of the FeatureStructure index containing FeatureStructures to be tested by this precondition. |
FSMatchConstraint |
getFsMatchConstraint()
Retrieves the FSMatchConstraint that determines which CAS feature structures will be tested by this precondition. |
String |
getPreconditionType()
Gets the type of this precondition. |
String |
getPredicate()
Retrieves the predicate used to compare the test value to the comparison value. |
void |
setComparisonValue(Object aValue)
Sets the literal value to which features' values will be compared. |
void |
setDefault(boolean aDefault)
Sets the deafult value for this precondition. |
void |
setFeatureName(String aFeatureName)
Sets the name of the feature to be tested. |
void |
setFsIndexName(String aIndexName)
Sets the name of the FeatureStructure index containing FeatureStructures to be tested by this precondition. |
void |
setFsMatchConstraint(FSMatchConstraint aConstraint)
Sets the FSMatchConstraint that determines which CAS feature structures will be tested by this precondition. |
void |
setPredicate(String aPredicate)
Sets the predicate used to compare the test value to the comparison value. |
Methods inherited from interface org.apache.uima.resource.metadata.Precondition |
---|
evaluate |
Methods inherited from interface org.apache.uima.resource.metadata.MetaDataObject |
---|
clone, equals, getAttributeValue, getSourceUrl, getSourceUrlString, isModifiable, listAttributes, setAttributeValue, setSourceUrl |
Methods inherited from interface org.apache.uima.util.XMLizable |
---|
buildFromXMLElement, buildFromXMLElement, toXML, toXML, toXML, toXML |
Field Detail |
---|
static final String PRECONDITION_TYPE
getPreconditionType()
.
static final String EQUAL
static final String ELEMENT_OF
static final String LANGUAGE_SUBSUMED
Method Detail |
---|
String getPreconditionType()
Precondition
has its
own standard type identifier String. These identifier Strings are used instead of Java class
names in order to ease portability of metadata to other languages.
getPreconditionType
in interface Precondition
PRECONDITION_TYPE
String getFsIndexName()
null
if the default annotation index should be
usedvoid setFsIndexName(String aIndexName)
aIndexName
- the name of the FS index, null
if the default annotation index should
be used
UIMA_UnsupportedOperationException
- if this MetaDataObject
is not modifiable.FSMatchConstraint getFsMatchConstraint()
null
if nonevoid setFsMatchConstraint(FSMatchConstraint aConstraint)
aConstraint
- the FS match constraint, null
if none
UIMA_UnsupportedOperationException
- if this MetaDataObject
is not modifiable.String getFeatureName()
null
if nonevoid setFeatureName(String aFeatureName)
aFeatureName
- the feature name, null
if none
UIMA_UnsupportedOperationException
- if this MetaDataObject
is not modifiable.Object getComparisonValue()
void setComparisonValue(Object aValue)
aValue
- the comparison value, which must be a String, Integer, Float, Boolean, or an array of
one of those four types.
UIMA_UnsupportedOperationException
- if this MetaDataObject
is not modifiable.String getPredicate()
void setPredicate(String aPredicate)
aPredicate
- a String that identifies the predicate used. This must match one of the constants
defined on this interface.
UIMA_UnsupportedOperationException
- if this MetaDataObject
is not modifiable.
UIMA_IllegalArgumentException
- if the given value is not appropriate for the given attribute.boolean getDefault()
void setDefault(boolean aDefault)
aDefault
- the default value
UIMA_UnsupportedOperationException
- if this MetaDataObject
is not modifiable.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |