jess
Class Binding

java.lang.Object
  |
  +--jess.Binding

public class Binding
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Binding binds variables to values; internally, also binds variables to slots in facts. Since it's just a bag of properties with no behaviour, member variables are public.

(C) 1997 E.J. Friedman-Hill and Sandia National Laboratories

Author:
E.J. Friedman-Hill
See Also:
Serialized Form

Field Summary
 int m_factIndex
          The fact within a token where this variable should be loaded from.
 java.lang.String m_name
          The name of the variable.
 int m_slotIndex
          The slot within a fact where this variable should be loaded from.
 int m_subIndex
          The subslot within a slot where this variable should be loaded from.
 int m_type
          The type of the variable
 Value m_val
          The value of the variable
 
Constructor Summary
Binding(java.lang.String name, int factIndex, int slotIndex, int subIndex, int type)
          Create a binding, setting initial values.
Binding(java.lang.String name, Value val)
          Create a binding, bound to a Value.
 
Method Summary
 java.lang.Object clone()
          Make a copy of the variable
 java.lang.String toString()
          Produce a string representation of this object for debugging.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_name

public java.lang.String m_name
The name of the variable.

m_factIndex

public int m_factIndex
The fact within a token where this variable should be loaded from.

m_slotIndex

public int m_slotIndex
The slot within a fact where this variable should be loaded from.

m_subIndex

public int m_subIndex
The subslot within a slot where this variable should be loaded from.

m_type

public int m_type
The type of the variable

m_val

public Value m_val
The value of the variable
Constructor Detail

Binding

public Binding(java.lang.String name,
               int factIndex,
               int slotIndex,
               int subIndex,
               int type)
Create a binding, setting initial values. This constructor is frequently used by Jess internally, but onlt Accelerator implementors will use it outside the Jess package.
Parameters:
name - The name of the variable.
factIndex - Which fact in a token it is matched to.
slotIndex - Which slot in the fact.
subIndex - Which subslot in a multislot or -1
type - One of the type constants in jess.RU.

Binding

public Binding(java.lang.String name,
               Value val)
        throws JessException
Create a binding, bound to a Value.
Parameters:
name - The name of the variable.
val - The value of the variable.
Method Detail

clone

public java.lang.Object clone()
Make a copy of the variable
Overrides:
clone in class java.lang.Object
Returns:
The copy.

toString

public java.lang.String toString()
Produce a string representation of this object for debugging.
Overrides:
toString in class java.lang.Object
Returns:
The string representation.

© 1997 E.J. Friedman-Hill and Sandia Corporation