Class SimplePrecondition_impl

java.lang.Object
org.apache.uima.resource.metadata.impl.MetaDataObject_impl
org.apache.uima.resource.metadata.impl.SimplePrecondition_impl
All Implemented Interfaces:
Serializable, Cloneable, MetaDataObject, Precondition, SimplePrecondition, XMLizable
Direct Known Subclasses:
LanguagePrecondition_impl, MimeTypePrecondition_impl

public class SimplePrecondition_impl extends MetaDataObject_impl implements SimplePrecondition
Reference implementation of SimplePrecondition.
See Also:
  • Constructor Details

    • SimplePrecondition_impl

      public SimplePrecondition_impl()
  • Method Details

    • getPreconditionType

      public String getPreconditionType()
      Description copied from interface: SimplePrecondition
      Gets the type of this precondition. Each sub-interface of 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.
      Specified by:
      getPreconditionType in interface Precondition
      Specified by:
      getPreconditionType in interface SimplePrecondition
      Returns:
      SimplePrecondition.PRECONDITION_TYPE
    • getDefault

      public boolean getDefault()
      Description copied from interface: SimplePrecondition
      Retrieves the default value for this precondition. This is the value returned if there is no applicable test value in the CAS.
      Specified by:
      getDefault in interface SimplePrecondition
      Returns:
      the default value
    • getFeatureName

      public String getFeatureName()
      Description copied from interface: SimplePrecondition
      Gets the name of the feature to be tested.
      Specified by:
      getFeatureName in interface SimplePrecondition
      Returns:
      the feature name, null if none
    • getFsIndexName

      public String getFsIndexName()
      Description copied from interface: SimplePrecondition
      Retrieves the name of the FeatureStructure index containing FeatureStructures to be tested by this precondition.
      Specified by:
      getFsIndexName in interface SimplePrecondition
      Returns:
      the name of the FS index, null if the default annotation index should be used
    • getFsMatchConstraint

      public FSMatchConstraint getFsMatchConstraint()
      Description copied from interface: SimplePrecondition
      Retrieves the FSMatchConstraint that determines which CAS feature structures will be tested by this precondition.
      Specified by:
      getFsMatchConstraint in interface SimplePrecondition
      Returns:
      the FS match constraint, null if none
    • setDefault

      public void setDefault(boolean aDefault)
      Description copied from interface: SimplePrecondition
      Sets the default value for this precondition. This is the value returned if there is no applicable test value in the CAS.
      Specified by:
      setDefault in interface SimplePrecondition
      Parameters:
      aDefault - the default value
    • setFeatureName

      public void setFeatureName(String aFeatureName)
      Description copied from interface: SimplePrecondition
      Sets the name of the feature to be tested.
      Specified by:
      setFeatureName in interface SimplePrecondition
      Parameters:
      aFeatureName - the feature name, null if none
    • setFsIndexName

      public void setFsIndexName(String aIndexName)
      Description copied from interface: SimplePrecondition
      Sets the name of the FeatureStructure index containing FeatureStructures to be tested by this precondition.
      Specified by:
      setFsIndexName in interface SimplePrecondition
      Parameters:
      aIndexName - the name of the FS index, null if the default annotation index should be used
    • setFsMatchConstraint

      public void setFsMatchConstraint(FSMatchConstraint aConstraint)
      Description copied from interface: SimplePrecondition
      Sets the FSMatchConstraint that determines which CAS feature structures will be tested by this precondition.
      Specified by:
      setFsMatchConstraint in interface SimplePrecondition
      Parameters:
      aConstraint - the FS match constraint, null if none
    • evaluate

      public boolean evaluate(CAS aCAS)
      Description copied from interface: Precondition
      Determines if this precondition is satisfied by a CAS.
      Specified by:
      evaluate in interface Precondition
      Parameters:
      aCAS - the CAS against which to evaluate this precondition
      Returns:
      true if and only if the CAS satisfies this precondition.
    • getComparisonValue

      public Object getComparisonValue()
      Description copied from interface: SimplePrecondition
      Retrieves the literal value to which features' values will be compared.
      Specified by:
      getComparisonValue in interface SimplePrecondition
      Returns:
      the value, which must be a String, Integer, Float, Boolean or an array of one of those four types.
    • setComparisonValue

      public void setComparisonValue(Object aValue)
      Description copied from interface: SimplePrecondition
      Sets the literal value to which features' values will be compared.
      Specified by:
      setComparisonValue in interface SimplePrecondition
      Parameters:
      aValue - the comparison value, which must be a String, Integer, Float, Boolean, or an array of one of those four types.
    • getPredicate

      public String getPredicate()
      Description copied from interface: SimplePrecondition
      Retrieves the predicate used to compare the test value to the comparison value.
      Specified by:
      getPredicate in interface SimplePrecondition
      Returns:
      a String that identifies the predicate used. This will always match one of the constants defined on this interface.
    • setPredicate

      public void setPredicate(String aPredicate)
      Description copied from interface: SimplePrecondition
      Sets the predicate used to compare the test value to the comparison value.
      Specified by:
      setPredicate in interface SimplePrecondition
      Parameters:
      aPredicate - a String that identifies the predicate used. This must match one of the constants defined on this interface.
    • isValidPredicateName

      protected static boolean isValidPredicateName(Object aName)
      Determines whether the given String is a valid name a predicate defined by this class. Valid predicate names are legal arguments to the setPredicate(String) method, and are defined by constants on the SimplePrecondition interface.
      Parameters:
      aName - an Object to test
      Returns:
      true if and only if aName is a String that is a valid predicate name.
    • getXmlizationInfo

      protected XmlizationInfo getXmlizationInfo()
      Description copied from class: MetaDataObject_impl
      To be implemented by subclasses to return information describing how to represent this object in XML.
      Specified by:
      getXmlizationInfo in class MetaDataObject_impl
      Returns:
      information defining this object's XML representation