org.eclipse.ocl.examples.domain.types
Class AbstractType

java.lang.Object
  extended by org.eclipse.ocl.examples.domain.types.AbstractType
All Implemented Interfaces:
DomainElement, DomainNamedElement, DomainNamespace, DomainType, Nameable, OCLValue
Direct Known Subclasses:
AbstractSpecializedType, AbstractTupleType, DomainInvalidTypeImpl, ExecutorLambdaType, ExecutorSpecializedType, ExecutorTupleType, ExecutorTypeParameter, JavaType

public abstract class AbstractType
extends java.lang.Object
implements DomainType


Field Summary
protected  java.lang.String name
           
protected  DomainStandardLibrary standardLibrary
           
 
Constructor Summary
AbstractType(DomainStandardLibrary standardLibrary, java.lang.String name)
           
 
Method Summary
 ObjectValue createInstance()
          Return a new instance of this type from valueFactory.
 Value createInstance(java.lang.String value)
          Return a new instance of this data type from valueFactory.
abstract  DomainType getCommonType(IdResolver idResolver, DomainType type)
          Return the most derived type com mon to this type and thatType within standardLibrary.
 DomainInheritance getInheritance(DomainStandardLibrary standardLibrary)
          Return the inheritance description for this type within standardLibrary.
 java.util.List<? extends DomainOperation> getLocalOperations()
           
 java.util.List<? extends DomainProperty> getLocalProperties()
           
 java.util.List<? extends DomainType> getLocalSuperTypes()
           
 java.lang.String getMetaTypeName()
          Return the name of the meta-type of this type.
 java.lang.String getName()
          Return the name of this type (without any decorations for specializations).
 DomainType getNormalizedType(DomainStandardLibrary standardLibrary)
          Return the unique executable form of this type within standardLibrary.
 java.util.List<? extends DomainProperty> getOwnedAttribute()
           
 java.util.List<? extends DomainConstraint> getOwnedInvariant()
           
 java.util.List<? extends DomainOperation> getOwnedOperation()
           
 java.util.List<? extends DomainConstraint> getOwnedRule()
           
 DomainPackage getPackage()
          Return the package containing this type.
 DomainStandardLibrary getStandardLibrary()
           
 DomainTypeParameters getTypeParameters()
          Return the ordered list of type parameters of this type.
 boolean isEqualToUnspecializedType(DomainStandardLibrary standardLibrary, DomainType type)
           
 boolean isInvalid()
          Return true if this is an invalid type (with an associated error message).
 boolean isOrdered()
          Return true if this type is a Collection type and has ordered elements.
 boolean isUnique()
          Return true if this type is a Collection type and has unique elements.
 boolean oclEquals(OCLValue thatValue)
          Return true if this is an equivalent OCL value to thatValue.
 int oclHashCode()
           
 DomainType specializeIn(DomainCallExp expr, DomainType selfType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ocl.examples.domain.elements.DomainType
conformsTo, getTypeId, isEqualTo, lookupImplementation
 

Field Detail

standardLibrary

@NonNull
protected final DomainStandardLibrary standardLibrary

name

@NonNull
protected final java.lang.String name
Constructor Detail

AbstractType

public AbstractType(@NonNull
                    DomainStandardLibrary standardLibrary,
                    @NonNull
                    java.lang.String name)
Method Detail

createInstance

@NonNull
public ObjectValue createInstance()
Description copied from interface: DomainType
Return a new instance of this type from valueFactory. Properties may be initialised using DomainProperty.initValue(Object, Object) provided no side-effect free OCL functionality is permitted to use the ObjectValue until initialisation has completed.

Specified by:
createInstance in interface DomainType

createInstance

@NonNull
public Value createInstance(@NonNull
                                    java.lang.String value)
Description copied from interface: DomainType
Return a new instance of this data type from valueFactory.

Specified by:
createInstance in interface DomainType
Parameters:
value - string initial value

getCommonType

@NonNull
public abstract DomainType getCommonType(@NonNull
                                                 IdResolver idResolver,
                                                 @NonNull
                                                 DomainType type)
Description copied from interface: DomainType
Return the most derived type com mon to this type and thatType within standardLibrary.

Specified by:
getCommonType in interface DomainType

getInheritance

@NonNull
public DomainInheritance getInheritance(@NonNull
                                                DomainStandardLibrary standardLibrary)
Description copied from interface: DomainType
Return the inheritance description for this type within standardLibrary.

Specified by:
getInheritance in interface DomainType

getLocalOperations

@NonNull
public java.util.List<? extends DomainOperation> getLocalOperations()
Specified by:
getLocalOperations in interface DomainType

getLocalProperties

@NonNull
public java.util.List<? extends DomainProperty> getLocalProperties()
Specified by:
getLocalProperties in interface DomainType

getLocalSuperTypes

@NonNull
public java.util.List<? extends DomainType> getLocalSuperTypes()
Specified by:
getLocalSuperTypes in interface DomainType

getMetaTypeName

@NonNull
public java.lang.String getMetaTypeName()
Description copied from interface: DomainType
Return the name of the meta-type of this type.

Specified by:
getMetaTypeName in interface DomainType

getName

public final java.lang.String getName()
Description copied from interface: DomainType
Return the name of this type (without any decorations for specializations).

Specified by:
getName in interface DomainType
Specified by:
getName in interface Nameable

getNormalizedType

@NonNull
public DomainType getNormalizedType(@NonNull
                                            DomainStandardLibrary standardLibrary)
Description copied from interface: DomainType
Return the unique executable form of this type within standardLibrary.

Specified by:
getNormalizedType in interface DomainType

getOwnedAttribute

@NonNull
public java.util.List<? extends DomainProperty> getOwnedAttribute()
Specified by:
getOwnedAttribute in interface DomainType

getOwnedInvariant

@NonNull
public java.util.List<? extends DomainConstraint> getOwnedInvariant()
Specified by:
getOwnedInvariant in interface DomainType

getOwnedOperation

@NonNull
public java.util.List<? extends DomainOperation> getOwnedOperation()
Specified by:
getOwnedOperation in interface DomainType

getOwnedRule

@NonNull
public java.util.List<? extends DomainConstraint> getOwnedRule()
Specified by:
getOwnedRule in interface DomainNamespace

getPackage

public DomainPackage getPackage()
Description copied from interface: DomainType
Return the package containing this type.

Specified by:
getPackage in interface DomainType

getStandardLibrary

public final DomainStandardLibrary getStandardLibrary()

getTypeParameters

@NonNull
public DomainTypeParameters getTypeParameters()
Description copied from interface: DomainType
Return the ordered list of type parameters of this type.

Specified by:
getTypeParameters in interface DomainType

isEqualToUnspecializedType

public boolean isEqualToUnspecializedType(@NonNull
                                          DomainStandardLibrary standardLibrary,
                                          @NonNull
                                          DomainType type)
Specified by:
isEqualToUnspecializedType in interface DomainType

isInvalid

public boolean isInvalid()
Description copied from interface: DomainType
Return true if this is an invalid type (with an associated error message).

Specified by:
isInvalid in interface DomainType

isOrdered

public boolean isOrdered()
Description copied from interface: DomainType
Return true if this type is a Collection type and has ordered elements.

Specified by:
isOrdered in interface DomainType

isUnique

public boolean isUnique()
Description copied from interface: DomainType
Return true if this type is a Collection type and has unique elements.

Specified by:
isUnique in interface DomainType

oclEquals

public boolean oclEquals(@NonNull
                         OCLValue thatValue)
Description copied from interface: OCLValue
Return true if this is an equivalent OCL value to thatValue.

Note that the caller must check that the argument is an OCLValue and should also check for the shortcut case that this == thatValue. Implementations are therefore wasting time if they re-implement the shortcut.

Specified by:
oclEquals in interface OCLValue

oclHashCode

public int oclHashCode()
Specified by:
oclHashCode in interface OCLValue

specializeIn

public DomainType specializeIn(@NonNull
                               DomainCallExp expr,
                               DomainType selfType)
Specified by:
specializeIn in interface DomainType