de.tuberlin.cs.cis.ocl.type
Class Property

java.lang.Object
  |
  +--de.tuberlin.cs.cis.ocl.type.Property

public class Property
extends java.lang.Object

A property describes a feature (i.e. attribute, association or operation) of a Type as defined in OCL 1.5.

Author:
fchabar

Field Summary
static int ASSOCIATION
          Indicats that a property is an association
static int ATTRIBUTE
          Indicats that a property is an attribute
static int OPERATION
          Indicates that a property is an operation
 
Constructor Summary
Property(Type predefType, java.lang.reflect.Method predefOp)
          Constructs a predefined property
Property(Type specType, de.tuberlin.cs.cis.ocl.parser.node.PExpression behaviour, int propertyClass)
          Constructs a let defined property
Property(Type type, TypedProperty behaviour, int propertyClass)
          Constructs a model property
 
Method Summary
 java.lang.Object getBehaviour()
          Returns the behaviour of this property.
 Type getType()
          Returns the type of the property.
 boolean isAssociation()
          Shows whether this property is an association.
 boolean isAttribute()
          Shows whether this property is an attribute.
 boolean isLetDefined()
          Shows if this property is defined via an let expression.
 boolean isModelProperty()
          Shows whether this property via the model
 boolean isOperation()
          Shows whether this property is an operation.
 boolean isPredefined()
          Shows whether this property is predefined within OCL 1.5.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OPERATION

public static final int OPERATION
Indicates that a property is an operation

See Also:
Constant Field Values

ATTRIBUTE

public static final int ATTRIBUTE
Indicats that a property is an attribute

See Also:
Constant Field Values

ASSOCIATION

public static final int ASSOCIATION
Indicats that a property is an association

See Also:
Constant Field Values
Constructor Detail

Property

public Property(Type predefType,
                java.lang.reflect.Method predefOp)
Constructs a predefined property

Parameters:
predefType - a predefined type (!= null).
predefOp - a method describing the behaviour of the type (!= null).

Property

public Property(Type type,
                TypedProperty behaviour,
                int propertyClass)
Constructs a model property

Parameters:
propertyClass - the class of property described (i.e. attribute, operation or association).

Property

public Property(Type specType,
                de.tuberlin.cs.cis.ocl.parser.node.PExpression behaviour,
                int propertyClass)
Constructs a let defined property

Parameters:
propertyClass - the class of property described (i.e. attribute, operation).
Method Detail

getType

public Type getType()
Returns the type of the property.

Returns:
the type of the property.

isLetDefined

public boolean isLetDefined()
Shows if this property is defined via an let expression.

Returns:
true if this property is defined via a let expression, false otherwise.

isModelProperty

public boolean isModelProperty()
Shows whether this property via the model

Returns:
true if this property is defined via the model, false otherwise.

isPredefined

public boolean isPredefined()
Shows whether this property is predefined within OCL 1.5.

Returns:
true if this property is defined via OCL1.5, false otherwise.

isOperation

public boolean isOperation()
Shows whether this property is an operation.

Returns:
true if this property is an operation, false otherwise.

isAssociation

public boolean isAssociation()
Shows whether this property is an association.

Returns:
true if this property is an association, false otherwise.

isAttribute

public boolean isAttribute()
Shows whether this property is an attribute.

Returns:
true if this property is an attribute, false otherwise.

toString

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

getBehaviour

public java.lang.Object getBehaviour()
Returns the behaviour of this property.

Returns:
the behaviour of this property. The type of the behaviour in case of a predefined property is Method, in case of a model-property TypedProperty, AExpression otherwise.