de.tuberlin.cs.cis.ocl.env
Class Binding

java.lang.Object
  |
  +--de.tuberlin.cs.cis.ocl.env.Binding
Direct Known Subclasses:
Annotation

public class Binding
extends java.lang.Object

binds an identifier to a value or/and a type.

Author:
fchabar

Constructor Summary
Binding(Identifier id)
          Constructs a binding with an identifier.
Binding(Identifier id, Property property)
          Constructs a binding with an identifier and its property.
Binding(Identifier id, Type type)
          Constructs a binding with an identifier and its type.
 
Method Summary
 Identifier getIdentifier()
          Returns the identifier bound in this binding.
 Property getProperty()
          Returns the property bound to the identifier.
 Type getType()
          Returns the type bound to the identifier.
 java.lang.Object getValue()
          Returns the value bound to the identifier.
 void setValue(java.lang.Object newValue)
          Sets the value to be bound to the identifier.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Binding

public Binding(Identifier id)
Constructs a binding with an identifier. This can be used to reserve the binding of an identifier.

Parameters:
id - the identifier

Binding

public Binding(Identifier id,
               Type type)
Constructs a binding with an identifier and its type.

Parameters:
id - the identifier
type - the type to be bound.

Binding

public Binding(Identifier id,
               Property property)
Constructs a binding with an identifier and its property.

Parameters:
id - the identifier
property - the property to be bound.
Method Detail

getType

public Type getType()
Returns the type bound to the identifier.

Returns:
the bound type.

getIdentifier

public Identifier getIdentifier()
Returns the identifier bound in this binding.

Returns:
the identifier

toString

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

getValue

public java.lang.Object getValue()
Returns the value bound to the identifier.

Returns:
the value of this binding.

setValue

public void setValue(java.lang.Object newValue)
Sets the value to be bound to the identifier.

Parameters:
newValue - the value of this binding.

getProperty

public Property getProperty()
Returns the property bound to the identifier.

Returns:
the property of this binding.