de.tuberlin.cs.cis.ocl.example.check
Class ExampleTypedProperty

java.lang.Object
  |
  +--de.tuberlin.cs.cis.ocl.example.check.ExampleTypedProperty
All Implemented Interfaces:
TypedAssociation, TypedProperty

public class ExampleTypedProperty
extends java.lang.Object
implements TypedAssociation

Implements a property in the context of the example model defined in OCL1.5 chapter 6.2.2 Example Class Diagram.

Author:
fchabar
See Also:
OCL 1.5 Standard

Field Summary
 
Fields inherited from interface de.tuberlin.cs.cis.ocl.model.check.TypedAssociation
UNBOUNDED
 
Constructor Summary
ExampleTypedProperty(java.lang.String propertyName, ClassifierDescriptor dtd)
          Constructs an attribute or operation of the example model.
ExampleTypedProperty(java.lang.String propertyName, ClassifierDescriptor modelType, int upperMultiplicity)
          Constructs an association end of the example model.
 
Method Summary
 boolean equals(java.lang.Object o)
          This property equals another property of the example model, if the names are equal.
 java.lang.String getName()
          Returns the name of this property.
 ClassifierDescriptor getType()
          Returns the type of this property (to be specific the type of the attribute, the return type of the operation or the type of a navigated association end).
 int getUpperMultiplicity()
          Returns the upper multiplicity of this association's association end (obtained by navigating the association).
 boolean isOrdered()
          Returns true if the navigation of this association should result in an ordered collection.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExampleTypedProperty

public ExampleTypedProperty(java.lang.String propertyName,
                            ClassifierDescriptor modelType,
                            int upperMultiplicity)
Constructs an association end of the example model.

Parameters:
propertyName - the name of the association end.
modelType - the type of the association end.
upperMultiplicity - the upper multiplicity of the association end

ExampleTypedProperty

public ExampleTypedProperty(java.lang.String propertyName,
                            ClassifierDescriptor dtd)
Constructs an attribute or operation of the example model.

Parameters:
propertyName - the name of the property.
dtd - the type of the property.
Method Detail

getUpperMultiplicity

public int getUpperMultiplicity()
Description copied from interface: TypedAssociation
Returns the upper multiplicity of this association's association end (obtained by navigating the association). In OCL the multiplicities are classified into the multiplicities zero, one and others. These multiplicity-classes will be used to determine the result of the navigation over this association.

Specified by:
getUpperMultiplicity in interface TypedAssociation
Returns:
the upper multiplicity obtained by navigating this association.
See Also:
TypedAssociation.UNBOUNDED

getType

public ClassifierDescriptor getType()
Description copied from interface: TypedProperty
Returns the type of this property (to be specific the type of the attribute, the return type of the operation or the type of a navigated association end). It is assumed that the model is self-contained. Therefore a DataTypeDescriptor of the same model is returned.

Specified by:
getType in interface TypedProperty
Returns:
the type of the property.

isOrdered

public boolean isOrdered()
Description copied from interface: TypedAssociation
Returns true if the navigation of this association should result in an ordered collection. If that is the case the collection result of this navigation will be a Sequence.

Specified by:
isOrdered in interface TypedAssociation
Returns:
true if the association is adorned with {ordered}, otherwise false.

getName

public java.lang.String getName()
Returns the name of this property.

Returns:
the property's name.

equals

public boolean equals(java.lang.Object o)
This property equals another property of the example model, if the names are equal.

Overrides:
equals in class java.lang.Object
Returns:
true if the object is a property of the example model and its name equals this property's name, false otherwise.

toString

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