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

java.lang.Object
  |
  +--de.tuberlin.cs.cis.ocl.env.Scope

public final class Scope
extends java.lang.Object

the scope of a name within the OCL-context.

Author:
fchabar

Constructor Summary
Scope(de.tuberlin.cs.cis.ocl.parser.node.PConstraint constraint)
          Constructs the specified constraint as scope.
Scope(de.tuberlin.cs.cis.ocl.parser.node.PContextBodypart bodypart)
          Constructs the specified context bodypart as scope.
Scope(de.tuberlin.cs.cis.ocl.parser.node.PPropertyCall propertyCall)
          Constructs the specified property call as scope.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 boolean includes(de.tuberlin.cs.cis.ocl.parser.node.Node node)
          Determines if this scope completly includes the specified node.
 boolean includes(Scope scope)
          Determines if this scope completly includes the specified scope.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scope

public Scope(de.tuberlin.cs.cis.ocl.parser.node.PPropertyCall propertyCall)
Constructs the specified property call as scope. Useable for formal parameters in a let-expression.

Parameters:
propertyCall - a property call.

Scope

public Scope(de.tuberlin.cs.cis.ocl.parser.node.PContextBodypart bodypart)
Constructs the specified context bodypart as scope. Useable for example for properties defined via a let-expression within a constraint.

Parameters:
bodypart - an OCL bodypart (to be specific an invariant, a postcondition or a precondition.)

Scope

public Scope(de.tuberlin.cs.cis.ocl.parser.node.PConstraint constraint)
Constructs the specified constraint as scope. Useable for example for porperties defined via a let-expression in a definition constraint.

Parameters:
constraint - an OCL context.
Method Detail

includes

public boolean includes(Scope scope)
Determines if this scope completly includes the specified scope.

Parameters:
scope - a scope (!= null)
Returns:
true if every token in the specified scope is a token of this scope, false otherwise.

includes

public boolean includes(de.tuberlin.cs.cis.ocl.parser.node.Node node)
Determines if this scope completly includes the specified node.

Parameters:
node - a node (!= null)
Returns:
true if every token of the specified node is a token of this scope, false otherwise.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object