org.opencyc.inferencesupport
Class Binding

java.lang.Object
  |
  +--org.opencyc.inferencesupport.Binding
All Implemented Interfaces:
java.lang.Comparable

public class Binding
extends java.lang.Object
implements java.lang.Comparable

Binding object to model the attributes and behavior of a variable binding to a value.

Author:
Stephen L. Reed

Copyright 2001 Cycorp, Inc., license is open source GNU LGPL.

the license

www.opencyc.org

OpenCyc at SourceForge

THIS SOFTWARE AND KNOWLEDGE BASE CONTENT ARE PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OPENCYC ORGANIZATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE AND KNOWLEDGE BASE CONTENT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

See Also:
UnitTest.testBinding()

Field Summary
protected  CycVariable cycVariable
          The CycVariable which is bound.
protected  java.lang.Object value
          The Object to which the CycVariable is bound.
 
Constructor Summary
Binding(CycVariable cycVariable, java.lang.Object value)
          Constructs a new Binding object for the given CycVariable and Object.
 
Method Summary
 java.lang.Object clone()
          Creates and returns a copy of this Binding.
 int compareTo(java.lang.Object object)
          Compares this object with the specified object for order.
 java.lang.String cyclify()
          Returns a cyclified String representation of the Binding object.
 boolean equals(java.lang.Object object)
          Returns true if some other object is equal to this Binding
 CycVariable getCycVariable()
          Returns the CycVariable which is bound.
 java.lang.Object getValue()
          Returns the Object to which the CycVariable is bound.
 java.lang.String toString()
          Returns a String representation of the Binding object.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cycVariable

protected CycVariable cycVariable
The CycVariable which is bound.

value

protected java.lang.Object value
The Object to which the CycVariable is bound.
Constructor Detail

Binding

public Binding(CycVariable cycVariable,
               java.lang.Object value)
Constructs a new Binding object for the given CycVariable and Object.
Parameters:
cycVariable - the variable which is bound
value - the value to which the variable is bound
Method Detail

toString

public java.lang.String toString()
Returns a String representation of the Binding object.
Overrides:
toString in class java.lang.Object
Returns:
a String representation of the Binding object.

cyclify

public java.lang.String cyclify()
Returns a cyclified String representation of the Binding object.
Returns:
a cyclified String representation of the Binding object.

getCycVariable

public CycVariable getCycVariable()
Returns the CycVariable which is bound.
Returns:
the CycVariable which is bound.

getValue

public java.lang.Object getValue()
Returns the Object to which the CycVariable is bound.
Returns:
the Object to which the CycVariable is bound.

equals

public boolean equals(java.lang.Object object)
Returns true if some other object is equal to this Binding
Overrides:
equals in class java.lang.Object
Parameters:
object - the reference object with which to compare.
Returns:
true if some other object is equal to this Binding

compareTo

public int compareTo(java.lang.Object object)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Specified by:
compareTo in interface java.lang.Comparable
Parameters:
object - the reference object with which to compare.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object

clone

public java.lang.Object clone()
Creates and returns a copy of this Binding.
Overrides:
clone in class java.lang.Object
Returns:
a clone of this instance