LBJ2.infer
Class ParameterizedConstraint

java.lang.Object
  extended by LBJ2.classify.Classifier
      extended by LBJ2.infer.ParameterizedConstraint
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public abstract class ParameterizedConstraint
extends Classifier

This class represents an LBJ constraint as it appears in a source file. When given its input object, an object of this class generates objects of type FirstOrderConstraint. ParameterizedConstraints are also Boolean Classifiers.

ParameterizedConstraint depends on extending classes to override the discreteValue(Object) method so that it returns "true" or "false" as appropriate. When this is done, there is no need to override the classify(Object) method.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class LBJ2.classify.Classifier
containingPackage, name
 
Constructor Summary
ParameterizedConstraint()
          Default constructor.
ParameterizedConstraint(java.lang.String n)
          Initializes the name.
 
Method Summary
 java.lang.String[] allowableValues()
          Returns the array of allowable values that a feature returned by this classifier may take.
 FeatureVector classify(java.lang.Object o)
          This method makes one or more decisions about a single object, returning those decisions as Features in a vector.
abstract  FirstOrderConstraint makeConstraint(java.lang.Object o)
          This method builds a first order constraint based on the given input object.
 
Methods inherited from class LBJ2.classify.Classifier
binaryRead, binaryRead, binaryRead, binaryRead, binaryWrite, binaryWrite, classify, clone, discreteValue, discreteValueArray, getCompositeChildren, getInputType, getOutputType, realValue, realValueArray, test, toString, valueIndexOf
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ParameterizedConstraint

public ParameterizedConstraint()
Default constructor.


ParameterizedConstraint

public ParameterizedConstraint(java.lang.String n)
Initializes the name.

Parameters:
n - The name of this constraint.
Method Detail

classify

public FeatureVector classify(java.lang.Object o)
This method makes one or more decisions about a single object, returning those decisions as Features in a vector.

Specified by:
classify in class Classifier
Parameters:
o - The object to make decisions about.
Returns:
A vector of Features about the input object.

allowableValues

public java.lang.String[] allowableValues()
Returns the array of allowable values that a feature returned by this classifier may take. If the array has length 0, it means either that the feature has discrete type and allowable values were not specified or that the feature has real or mixed type. The default return value of this method is a 0 length array.

This method should be overridden by derived classes.

Overrides:
allowableValues in class Classifier
Returns:
The allowable values that a feature returned by this classifier may take.

makeConstraint

public abstract FirstOrderConstraint makeConstraint(java.lang.Object o)
This method builds a first order constraint based on the given input object.

Parameters:
o - The object to build a constraint with respect to.
Returns:
A first order constraint.