LBJ2.infer
Class FirstOrderVariable

java.lang.Object
  extended by LBJ2.infer.FirstOrderVariable
All Implemented Interfaces:
java.lang.Cloneable

public class FirstOrderVariable
extends java.lang.Object
implements java.lang.Cloneable

Represents a classifier application. An inference algorithm may change the value returned by the classifier application when satisfying constraints.


Field Summary
private  Learner classifier
          The classifier being applied.
private  java.lang.Object example
          The classifier is applied to this example object.
private  ScoreSet scores
          The scores of the possible values this variable might be set to.
private  java.lang.String value
          The value imposed on the classifier when applied to the example.
 
Constructor Summary
FirstOrderVariable(Learner c, java.lang.Object e)
          Initializing constructor.
 
Method Summary
 java.lang.Object clone()
          This method returns a shallow clone.
 boolean equals(java.lang.Object o)
          Two FirstOrderVariables are equivalent when their classifiers are equivalent and they store the same example object.
 Learner getClassifier()
          Retrieves the classifier.
 java.lang.Object getExample()
          Retrieves the example object.
 double getScore()
          Retrieves the score of the current value of this variable.
 ScoreSet getScores()
          Retrieves all the scores for the values this variable may take.
 java.lang.String getValue()
          Retrieves the value this variable currently takes.
 int hashCode()
          The hash code of a FirstOrderVariable is the hash code of the string representation of the classifier plus the system's hash code for the example object.
 void setExample(java.lang.Object e)
          Sets the example object.
 void setValue(java.lang.String v)
          Sets the value of this variable.
 java.lang.String toString()
          Returns a string representation of this variable.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

classifier

private Learner classifier
The classifier being applied.


example

private java.lang.Object example
The classifier is applied to this example object.


scores

private ScoreSet scores
The scores of the possible values this variable might be set to.


value

private java.lang.String value
The value imposed on the classifier when applied to the example.

Constructor Detail

FirstOrderVariable

public FirstOrderVariable(Learner c,
                          java.lang.Object e)
Initializing constructor.

Parameters:
c - The classifier being applied.
e - The classifier is applied to this example object.
Method Detail

getClassifier

public Learner getClassifier()
Retrieves the classifier.


getExample

public java.lang.Object getExample()
Retrieves the example object.


getValue

public java.lang.String getValue()
Retrieves the value this variable currently takes.


setValue

public void setValue(java.lang.String v)
Sets the value of this variable.

Parameters:
v - The new value of this variable.

setExample

public void setExample(java.lang.Object e)
Sets the example object.

Parameters:
e - The new example object.

getScore

public double getScore()
Retrieves the score of the current value of this variable.


getScores

public ScoreSet getScores()
Retrieves all the scores for the values this variable may take.


toString

public java.lang.String toString()
Returns a string representation of this variable.

Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
The hash code of a FirstOrderVariable is the hash code of the string representation of the classifier plus the system's hash code for the example object.

Overrides:
hashCode in class java.lang.Object
Returns:
The hash code of this FirstOrderVariable.

equals

public boolean equals(java.lang.Object o)
Two FirstOrderVariables are equivalent when their classifiers are equivalent and they store the same example object.

Overrides:
equals in class java.lang.Object
Parameters:
o - The object to test equivalence with.
Returns:
true iff this object is equivalent to the argument object.

clone

public java.lang.Object clone()
This method returns a shallow clone.

Overrides:
clone in class java.lang.Object
Returns:
A shallow clone.