Class TLcdFeaturedMultiShapeList
- All Implemented Interfaces:
ILcdDataObject,ILcdBounded,ILcdEditableShapeList,ILcdShape,ILcdShapeList,ILcdCloneable,ILcdFeatured,ILcdInvalidateable,Serializable,Cloneable
ILcdDataObject,
and ILcdShapeList that contains one or more shapes. It also implements
ILcdFeatured. Features are directly mapped one-on-one on
data properties.
An optional index can specify the feature that determines the identity of
the object (through equals and hashCode). This index
is typically derived from the data type using the TLcdPrimaryKeyAnnotation.
Because of this, this class is mostly useful when used to represent objects that are
lazily retrieved from a database.
- Since:
- 8.3.03
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTLcdFeaturedMultiShapeList(TLcdFeaturedMultiShapeList aFeaturedMultiShapeList) Constructs aTLcdFeaturedSingleShapeListthat is a copy of the given instance.TLcdFeaturedMultiShapeList(ILcdShape[] aShapes, Object[] aFeatures) Deprecated.TLcdFeaturedMultiShapeList(ILcdShape[] aShapes, Object[] aFeatures, int aPrimaryFeatureIndex) Deprecated.TLcdFeaturedMultiShapeList(ILcdShape[] aShapes, Object[] aFeatures, TLcdDataType aDataType) Constructs aTLcdFeaturedSingleShapeList. -
Method Summary
Modifier and TypeMethodDescriptionvoidInserts the specified shape at the specified position in thisILcdShapeList.voidAppends the specified shape to the end of thisILcdShapeList.voidAppends the specified array of shapes to the end of thisILcdShapeList.voidRemoves all of the shapes from thisILcdShapeList.clone()MakesObject.clone()public.booleancontains2D(double aX, double aY) Checks whether thisILcdShapecontains the given point in the 2D space.booleancontains2D(ILcdPoint aPoint) Checks whether thisILcdShapecontains the givenILcdPointin the 2D space.booleancontains3D(double aX, double aY, double aZ) Checks whether thisILcdShapecontains the given point in the 3D space.booleancontains3D(ILcdPoint aPoint) Checks whether thisILcdShapecontains the givenILcdPointin the 3D space.booleanReturns theILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.Returns the type of this data object.Returns the focus point of thisILcdShape.Returns the primary feature, ornullif there is no such feature.intReturns the index of the primary feature, which identifies the object.getShape(int aIndex) Returns theILcdShapeat the given index.intReturns the number ofILcdShapeobjects in the list.getValue(TLcdDataProperty aProperty) Returns the value of the given property.Convenience method that returns the value of the property with the given name.inthashCode()booleanhasValue(TLcdDataProperty aProperty) Indicates whether this data object has a value for the given property.booleanIndicates whether this data object has a value for the given property.voidNotifies this object that its bounds have changed because one of its shapes has changed.voidInvalidates all cached values of this object.removeShape(int aIndex) Removes the shape at the specified position in thisILcdShapeList.booleanremoveShape(ILcdShape aShape) Removes the first occurrence of the specified shape in thisILcdShapeList.voidremoveShapes(ILcdShape[] aShapes) Removes all shapes from thisILcdShapeListthat are contained in the specified array of shapes.Replaces the shape at the specified position in thisILcdShapeListwith the specified shape.voidReplace the list of shapes contained in thisILcdShapeListwith the specified array of shapes.voidsetValue(TLcdDataProperty aProperty, Object aValue) Sets the value of the given property for this data object.voidConvenience method that sets the value of the property with the given name.voidshapeChanged(int aIndex) Notifies thisILcdShapeListthat the shape at the specified position has changed.voidshapeChanged(ILcdShape aShape) Notifies thisILcdShapeListthat the specified shape has changed.voidNotifies thisILcdShapeListthat some (possibly all) of its shapes have changed.Methods inherited from class com.luciad.util.TLcdFeatureArray
canSetFeature, getFeature, getFeatureCount, setFeature, setFeaturesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.util.ILcdFeatured
canSetFeature, getFeature, getFeatureCount, setFeature
-
Constructor Details
-
TLcdFeaturedMultiShapeList
Deprecated.Constructs aTLcdFeaturedSingleShapeList, without a primary feature. -
TLcdFeaturedMultiShapeList
@Deprecated public TLcdFeaturedMultiShapeList(ILcdShape[] aShapes, Object[] aFeatures, int aPrimaryFeatureIndex) Deprecated.Constructs aTLcdFeaturedSingleShapeList, with the specified primary feature. -
TLcdFeaturedMultiShapeList
Constructs aTLcdFeaturedSingleShapeList. The primary feature index of this object is defined by theTLcdPrimaryKeyAnnotationon the given data type. -
TLcdFeaturedMultiShapeList
Constructs aTLcdFeaturedSingleShapeListthat is a copy of the given instance.
-
-
Method Details
-
getPrimaryFeatureIndex
public int getPrimaryFeatureIndex()Returns the index of the primary feature, which identifies the object. A value of -1 indicates that there is no such feature. -
getPrimaryFeature
Returns the primary feature, ornullif there is no such feature. -
invalidateObject
public void invalidateObject()Description copied from interface:ILcdInvalidateableInvalidates all cached values of this object. Call this method whenever one or more of this object's compositing values has been changed, to notify this object it needs to recompute its cached values.- Specified by:
invalidateObjectin interfaceILcdInvalidateable
-
invalidateBounds
public void invalidateBounds()Notifies this object that its bounds have changed because one of its shapes has changed. -
getShapeCount
public int getShapeCount()Description copied from interface:ILcdShapeListReturns the number ofILcdShapeobjects in the list.- Specified by:
getShapeCountin interfaceILcdShapeList- Returns:
- the number of
ILcdShapeobjects in the list.
-
getShape
Description copied from interface:ILcdShapeListReturns theILcdShapeat the given index.- Specified by:
getShapein interfaceILcdShapeList- Parameters:
aIndex- a valid index in the list ofILcdShapeobjects.- Returns:
- the
ILcdShapeat the given index. - Throws:
IndexOutOfBoundsException- when the index is not valid.
-
contains2D
Description copied from interface:ILcdShapeChecks whether thisILcdShapecontains the givenILcdPointin the 2D space. Only the first two dimensions of theILcdShapeand theILcdPointare considered.- Specified by:
contains2Din interfaceILcdShape- Parameters:
aPoint- theILcdPointto test.- Returns:
- the boolean result of the containment test.
- See Also:
-
contains2D
public boolean contains2D(double aX, double aY) Description copied from interface:ILcdShapeChecks whether thisILcdShapecontains the given point in the 2D space. Only the first two dimensions of theILcdShapeare considered.- Specified by:
contains2Din interfaceILcdShape- Parameters:
aX- the x coordinate of the point.aY- the y coordinate of the point.- Returns:
- the boolean result of the containment test.
-
contains3D
Description copied from interface:ILcdShapeChecks whether thisILcdShapecontains the givenILcdPointin the 3D space.- Specified by:
contains3Din interfaceILcdShape- Parameters:
aPoint- theILcdPointto test.- Returns:
- the boolean result of the containment test.
- See Also:
-
contains3D
public boolean contains3D(double aX, double aY, double aZ) Description copied from interface:ILcdShapeChecks whether thisILcdShapecontains the given point in the 3D space.- Specified by:
contains3Din interfaceILcdShape- Parameters:
aX- the x coordinate of the point.aY- the y coordinate of the point.aZ- the z coordinate of the point.- Returns:
- the boolean result of the containment test.
-
getFocusPoint
Description copied from interface:ILcdShapeReturns the focus point of thisILcdShape.- Specified by:
getFocusPointin interfaceILcdShape- Returns:
- the focus point of this
ILcdShape.
-
getBounds
Description copied from interface:ILcdBoundedReturns theILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.If the geometry does not allow retrieving valid bounds (for example a polyline with 0 points) the return value is unspecified. It is highly recommended to return an
undefinedbounds. You can create undefined bounds using the default constructors ofTLcdLonLatBoundsorTLcdXYBounds.- Specified by:
getBoundsin interfaceILcdBounded- Returns:
- the
ILcdBoundsby which the geometry of thisILcdBoundedobject is bounded.
-
equals
-
hashCode
public int hashCode() -
clone
Description copied from interface:ILcdCloneableMakes
When for example extending fromObject.clone()public.java.lang.Object, it can be implemented like this:public Object clone() { try { return super.clone(); } catch ( CloneNotSupportedException e ) { // Cannot happen: extends from Object and implements Cloneable (see also Object.clone) throw new RuntimeException( e ); } }- Specified by:
clonein interfaceILcdCloneable- Overrides:
clonein classTLcdFeatureArray- See Also:
-
getDataType
Description copied from interface:ILcdDataObjectReturns the type of this data object. This can never benull.- Specified by:
getDataTypein interfaceILcdDataObject- Returns:
- the type of this data object
-
getValue
Description copied from interface:ILcdDataObjectReturns the value of the given property.
If the property is a collection, the returned value will never be null. If the property has not been set, an empty collection of the appropriate type will be returned (Set, List or Map).
The property must not be null, and must be declared in the
data object's typeor in one of its super types. Otherwise anIllegalArgumentExceptionis thrown.- Specified by:
getValuein interfaceILcdDataObject- Parameters:
aProperty- the property for which the value is to be returned- Returns:
- the value of the given property for this data object
-
getValue
Description copied from interface:ILcdDataObjectConvenience method that returns the value of the property with the given name.
If more than one property exists with the given name, the most specific property should be used (this is the property defined by the most specialized type in this object's data type hierarchy). SeeILcdDataObject.getValue(TLcdDataProperty)for more information.- Specified by:
getValuein interfaceILcdDataObject- Parameters:
aPropertyName- the name of the property of which the value is to be returned- Returns:
- the value of the property with the given name
- See Also:
-
setValue
Description copied from interface:ILcdDataObjectSets the value of the given property for this data object. The implementation is allowed to throw an exception if the given value can't be set.
The given property must be declared in thedata object's typeor in one of its super types. In other words, getDataType().getProperties().contains( aProperty ) should always be true. Otherwise, the implementation should throw anIllegalArgumentException.- Specified by:
setValuein interfaceILcdDataObject- Parameters:
aProperty- the property for which the value is to be setaValue- the value to set- See Also:
-
setValue
Description copied from interface:ILcdDataObjectConvenience method that sets the value of the property with the given name.
If more than one property exists with the given name, the most specific property should be used (this is the property defined by the most specialized type in this object's data type hierarchy). SeeILcdDataObject.setValue(TLcdDataProperty, Object)for more information.- Specified by:
setValuein interfaceILcdDataObject- Parameters:
aPropertyName- the name of the property of which the value is to be setaValue- the value to set
-
hasValue
Description copied from interface:ILcdDataObjectIndicates whether this data object has a value for the given property.aPropertyis from theright data type, and this instance has a value for it: returnstrueaPropertyis from theright data type, and this instance has no value for it: returnsfalseaPropertyis not from theright data type: not allowed, you will get IllegalArgumentExceptionaPropertyisnull: not allowed, you will get NullPointerException
- Specified by:
hasValuein interfaceILcdDataObject- Parameters:
aProperty- the property for which to return whether a value is present or not.- Returns:
trueif this data object has a value for the given property,falseotherwise.
-
hasValue
Description copied from interface:ILcdDataObjectIndicates whether this data object has a value for the given property.
SeeILcdDataObject.hasValue(TLcdDataProperty)for more information.- Specified by:
hasValuein interfaceILcdDataObject- Parameters:
aPropertyName- the name of the property for which to return whether a value is present or not.- Returns:
trueif this data object has a value for the property with the given name,falseotherwise.
-
addShape
Description copied from interface:ILcdEditableShapeListInserts the specified shape at the specified position in thisILcdShapeList.- Specified by:
addShapein interfaceILcdEditableShapeList- Parameters:
aIndex- the index at which the shape is to be inserted.aShape- the shape to be inserted.
-
addShape
Description copied from interface:ILcdEditableShapeListAppends the specified shape to the end of thisILcdShapeList.- Specified by:
addShapein interfaceILcdEditableShapeList- Parameters:
aShape- the shape to be appended to thisILcdShapeList.
-
addShapes
Description copied from interface:ILcdEditableShapeListAppends the specified array of shapes to the end of thisILcdShapeList.- Specified by:
addShapesin interfaceILcdEditableShapeList- Parameters:
aShapes- the array of shapes to be appended to thisILcdShapeList.
-
clearShapes
public void clearShapes()Description copied from interface:ILcdEditableShapeListRemoves all of the shapes from thisILcdShapeList.- Specified by:
clearShapesin interfaceILcdEditableShapeList
-
removeShape
Description copied from interface:ILcdEditableShapeListRemoves the shape at the specified position in thisILcdShapeList. Shifts any subsequent shapes to the left. Returns the shape that was removed from thisILcdShapeList.- Specified by:
removeShapein interfaceILcdEditableShapeList- Parameters:
aIndex- the index of the shape to removed.- Returns:
- the shape previously at the specified position.
-
removeShape
Description copied from interface:ILcdEditableShapeListRemoves the first occurrence of the specified shape in thisILcdShapeList. If thisILcdShapeListdoes not contain the shape, it is unchanged.- Specified by:
removeShapein interfaceILcdEditableShapeList- Parameters:
aShape- the shape to be removed, if present.- Returns:
trueif thisILcdShapeListcontained the specified element.
-
removeShapes
Description copied from interface:ILcdEditableShapeListRemoves all shapes from thisILcdShapeListthat are contained in the specified array of shapes.- Specified by:
removeShapesin interfaceILcdEditableShapeList- Parameters:
aShapes- the array of shapes to be removed from thisILcdShapeList.
-
setShape
Description copied from interface:ILcdEditableShapeListReplaces the shape at the specified position in thisILcdShapeListwith the specified shape.- Specified by:
setShapein interfaceILcdEditableShapeList- Parameters:
aIndex- index of shape to replace.aShape- the shape to be stored at the specified position.- Returns:
- the shape previously at the specified position.
-
setShapes
Description copied from interface:ILcdEditableShapeListReplace the list of shapes contained in thisILcdShapeListwith the specified array of shapes.- Specified by:
setShapesin interfaceILcdEditableShapeList- Parameters:
aShapes- the array of shapes to be stored in thisILcdShapeList.
-
shapeChanged
public void shapeChanged(int aIndex) Description copied from interface:ILcdEditableShapeListNotifies thisILcdShapeListthat the shape at the specified position has changed.- Specified by:
shapeChangedin interfaceILcdEditableShapeList- Parameters:
aIndex- the index of the shape that has changed.
-
shapeChanged
Description copied from interface:ILcdEditableShapeListNotifies thisILcdShapeListthat the specified shape has changed.- Specified by:
shapeChangedin interfaceILcdEditableShapeList- Parameters:
aShape- the shape that has changed.
-
shapesChanged
public void shapesChanged()Description copied from interface:ILcdEditableShapeListNotifies thisILcdShapeListthat some (possibly all) of its shapes have changed.- Specified by:
shapesChangedin interfaceILcdEditableShapeList
-
TLcdFeaturedMultiShapeList(ILcdShape[], Object[], TLcdDataType)