forge.solve
Class Binding

java.lang.Object
  extended by forge.solve.Binding
All Implemented Interfaces:
ProgramElement

public final class Binding
extends java.lang.Object
implements ProgramElement

Binds variables to constants.

Author:
Greg Dennis (gdennis@mit.edu)

Constructor Summary
Binding(ForgeBounds bounds)
          Constructs an empty binding.
 
Method Summary
 java.util.Set<ForgeExpression.Modifiable> bound()
          Returns an unmodifiable view of the set of bound modifiables.
 ForgeBounds bounds()
          Returns the bounds to which this binding belongs.
 Binding copy()
          Constructs a copy of the specified binding.
 ForgeConstant getValue(ForgeExpression.Modifiable mod)
          Returns the constant to which the given modifiable is bound.
 ForgeProgram program()
          Returns the program to which this element belongs.
 void putValue(ForgeExpression.Modifiable mod, ForgeConstant value)
          Maps the given modifiable to the given constant.
 java.lang.String toString()
           
 Binding unmodifiableView()
          Returns an unmodifiable view of this binding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Binding

public Binding(ForgeBounds bounds)
Constructs an empty binding.

Method Detail

copy

public Binding copy()
Constructs a copy of the specified binding.


unmodifiableView

public Binding unmodifiableView()
Returns an unmodifiable view of this binding.


program

public ForgeProgram program()
Description copied from interface: ProgramElement
Returns the program to which this element belongs.

Specified by:
program in interface ProgramElement

bounds

public ForgeBounds bounds()
Returns the bounds to which this binding belongs.


bound

public java.util.Set<ForgeExpression.Modifiable> bound()
Returns an unmodifiable view of the set of bound modifiables.


getValue

public ForgeConstant getValue(ForgeExpression.Modifiable mod)
Returns the constant to which the given modifiable is bound.


putValue

public void putValue(ForgeExpression.Modifiable mod,
                     ForgeConstant value)
Maps the given modifiable to the given constant.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object