org.eclipse.ocl.examples.codegen.java.types
Class BoxedValuesDescriptor

java.lang.Object
  extended by org.eclipse.ocl.examples.codegen.java.types.AbstractDescriptor
      extended by org.eclipse.ocl.examples.codegen.java.types.AbstractValueDescriptor
          extended by org.eclipse.ocl.examples.codegen.java.types.BoxedValuesDescriptor
All Implemented Interfaces:
TypeDescriptor, BoxedDescriptor

public class BoxedValuesDescriptor
extends AbstractValueDescriptor
implements BoxedDescriptor

A BoxedValueDescriptor describes a type whose boxed representation differs from its unboxed representation. It has a pivot ElementId and a Java class.

Thus an IntegerValue is a TypeId.INTEGER and an org.eclipse.ocl.examples.domain.values.IntegerValue.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.ocl.examples.codegen.java.types.AbstractDescriptor
AbstractDescriptor.NamedFuture
 
Field Summary
protected  CollectionDescriptor unboxedDescriptor
           
 
Fields inherited from class org.eclipse.ocl.examples.codegen.java.types.AbstractValueDescriptor
javaClass
 
Fields inherited from class org.eclipse.ocl.examples.codegen.java.types.AbstractDescriptor
elementId
 
Constructor Summary
BoxedValuesDescriptor(ElementId elementId, java.lang.Class<?> javaClass, CollectionDescriptor unboxedDescriptor)
           
 
Method Summary
 java.lang.Boolean appendUnboxStatements(JavaStream js, JavaLocalContext localContext, CGUnboxExp cgUnboxExp, CGValuedElement boxedValue)
           
 UnboxedDescriptor getUnboxedDescriptor()
          Return the type descriptor for use when an unboxed type would be appropriate.
 boolean isAssignableFrom(TypeDescriptor typeDescriptor)
          Return true if an instance described by typeDescriptor may be assigned to an instance described by this.
 
Methods inherited from class org.eclipse.ocl.examples.codegen.java.types.AbstractValueDescriptor
append, getClassName, getJavaClass, hasJavaClass, isAssignableTo, toString
 
Methods inherited from class org.eclipse.ocl.examples.codegen.java.types.AbstractDescriptor
appendBox, appendCast, appendCastTerm, appendEqualsValue, appendNotEqualsTerm, asCollectionDescriptor, getEClassifier, getElementId, getPrimitiveDescriptor, reClass, zzisBoxedType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.ocl.examples.codegen.generator.TypeDescriptor
append, appendBox, appendCast, appendCastTerm, appendEqualsValue, appendNotEqualsTerm, asCollectionDescriptor, getClassName, getEClassifier, getJavaClass, getPrimitiveDescriptor, hasJavaClass, isAssignableTo
 

Field Detail

unboxedDescriptor

@NonNull
protected final CollectionDescriptor unboxedDescriptor
Constructor Detail

BoxedValuesDescriptor

public BoxedValuesDescriptor(@NonNull
                             ElementId elementId,
                             @NonNull
                             java.lang.Class<?> javaClass,
                             @NonNull
                             CollectionDescriptor unboxedDescriptor)
Method Detail

appendUnboxStatements

@NonNull
public java.lang.Boolean appendUnboxStatements(@NonNull
                                                       JavaStream js,
                                                       @NonNull
                                                       JavaLocalContext localContext,
                                                       @NonNull
                                                       CGUnboxExp cgUnboxExp,
                                                       @NonNull
                                                       CGValuedElement boxedValue)
Specified by:
appendUnboxStatements in interface TypeDescriptor
Overrides:
appendUnboxStatements in class AbstractDescriptor

getUnboxedDescriptor

@NonNull
public UnboxedDescriptor getUnboxedDescriptor()
Description copied from interface: TypeDescriptor
Return the type descriptor for use when an unboxed type would be appropriate. Returns this when this is an unboxed descriptor.

Specified by:
getUnboxedDescriptor in interface TypeDescriptor

isAssignableFrom

public final boolean isAssignableFrom(@NonNull
                                      TypeDescriptor typeDescriptor)
Description copied from interface: TypeDescriptor
Return true if an instance described by typeDescriptor may be assigned to an instance described by this.

Specified by:
isAssignableFrom in interface TypeDescriptor