public class TLcdShapeListAnnotation extends Object implements ILcdAnnotation
ILcdShape
instances that can be contained
within a shape list.
If the instance class of a data type implements ILcdShapeList
, this annotation can be set
on the data type to provide information on which ILcdShape
instances are allowed
to be contained in the shape list implementation of instances of this data type.
For example, if a data type MyFeature
has instance class TLcdFeaturedShapeList
,
setting a TLcdShapeListAnnotation
annotation on this data type with shape classes
ILcdPoint
and ILcdPolyline
would indicate that only ILcdPoint
and
ILcdPolyline
instances may be stored as shapes in the shape list instances of
MyFeature
.
Note that this annotation is purely informative and that implementations of ILcdShapeList
are not required to enforce this constraint.Constructor and Description |
---|
TLcdShapeListAnnotation(boolean aContainsSingleShape,
Class<? extends ILcdShape>... aShapeClasses)
Creates a new
TLcdShapeListAnnotation with the specified list of shape classes and
the given value for containsSingleShape . |
TLcdShapeListAnnotation(boolean aContainsSingleShape,
Set<Class<? extends ILcdShape>> aShapeClasses)
Creates a new
TLcdShapeListAnnotation with the specified list of shape classes. |
TLcdShapeListAnnotation(Class<? extends ILcdShape>... aShapeClasses)
Creates a new
TLcdShapeListAnnotation with the specified list of shape classes. |
TLcdShapeListAnnotation(Set<Class<? extends ILcdShape>> aShapeClasses)
Creates a new
TLcdShapeListAnnotation with the specified list of shape classes. |
Modifier and Type | Method and Description |
---|---|
boolean |
containsSingleShape()
Returns true if the shape list always contains at most a single shape.
|
Set<Class<? extends ILcdShape>> |
getShapeClasses()
Returns the set of shape classes which are allowed as shapes on the shape list instances of
this annotation's data type.
|
public TLcdShapeListAnnotation(Set<Class<? extends ILcdShape>> aShapeClasses)
TLcdShapeListAnnotation
with the specified list of shape classes.
containsSingleShape
is set to false
.aShapeClasses
- the set of shape classes that is allowed as shape on the instances of
this annotation's data type.public TLcdShapeListAnnotation(boolean aContainsSingleShape, Set<Class<? extends ILcdShape>> aShapeClasses)
TLcdShapeListAnnotation
with the specified list of shape classes.aShapeClasses
- the set of shape classes that is allowed as shape on the instances of
this annotation's data type.public TLcdShapeListAnnotation(Class<? extends ILcdShape>... aShapeClasses)
TLcdShapeListAnnotation
with the specified list of shape classes.
containsSingleShape
is set to false
.aShapeClasses
- the shape classes that are allowed as shape on the instances of
this annotation's data type.public TLcdShapeListAnnotation(boolean aContainsSingleShape, Class<? extends ILcdShape>... aShapeClasses)
TLcdShapeListAnnotation
with the specified list of shape classes and
the given value for containsSingleShape
.aShapeClasses
- the shape classes that are allowed as shape on the instances of
this annotation's data type.public Set<Class<? extends ILcdShape>> getShapeClasses()
public boolean containsSingleShape()
ILcdShapeList
because that's a simple ILcdShape
interface to implement. Also, it allows the domain
object to be used for many different shapes without having to implement other shape interfaces.