LBJ2.classify
Class ValueComparer

java.lang.Object
  extended by LBJ2.classify.Classifier
      extended by LBJ2.classify.ValueComparer
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
MultiValueComparer

public class ValueComparer
extends Classifier

This classifier applies another classifier to the example object and returns a Boolean feature (with value "true" or "false") representing the equality of the argument classifier's feature value to a given value.

See Also:
MultiValueComparer, Serialized Form

Field Summary
protected  Classifier labeler
          The classifier whose value will be compared.
protected  java.lang.String value
          The value to compare with.
 
Fields inherited from class LBJ2.classify.Classifier
containingPackage, name
 
Constructor Summary
ValueComparer(Classifier c, java.lang.String v)
          Constructor.
 
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)
          Returns a Boolean feature (with value "true" or "false") representing the equality of the output of labeler applied to the argument object and value.
 java.lang.String getInputType()
          Returns a string describing the input type of this classifier.
 void setLabeler(Classifier l)
          Sets the value of labeler.
 java.lang.String toString()
          The String representation of a ValueComparer has the form "ValueComparer(child), where child is the String representation of the classifier whose value is being compared.
 
Methods inherited from class LBJ2.classify.Classifier
binaryRead, binaryRead, binaryRead, binaryRead, binaryWrite, binaryWrite, classify, clone, discreteValue, discreteValueArray, getCompositeChildren, getOutputType, realValue, realValueArray, test, valueIndexOf
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

labeler

protected Classifier labeler
The classifier whose value will be compared.


value

protected java.lang.String value
The value to compare with.

Constructor Detail

ValueComparer

public ValueComparer(Classifier c,
                     java.lang.String v)
Constructor.

Parameters:
c - The classifier whose value will be compared.
v - The value to compare with.
Method Detail

setLabeler

public void setLabeler(Classifier l)
Sets the value of labeler.


classify

public FeatureVector classify(java.lang.Object o)
Returns a Boolean feature (with value "true" or "false") representing the equality of the output of labeler applied to the argument object and value.

Specified by:
classify in class Classifier
Parameters:
o - The object to make decisions about.
Returns:
A feature vector containing the feature described above.

getInputType

public java.lang.String getInputType()
Returns a string describing the input type of this classifier.

Overrides:
getInputType in class Classifier
Returns:
A string describing the input type of this classifier.

allowableValues

public java.lang.String[] allowableValues()
Returns the array of allowable values that a feature returned by this classifier may take.

Overrides:
allowableValues in class Classifier
Returns:
DiscreteFeature.BooleanValues
See Also:
DiscreteFeature.BooleanValues

toString

public java.lang.String toString()
The String representation of a ValueComparer has the form "ValueComparer(child), where child is the String representation of the classifier whose value is being compared.

Overrides:
toString in class Classifier
Returns:
A string of the form described above.