public class TLcdGML32AbstractFeatureCollection extends TLcdGML32AbstractFeature implements ILcd2DBoundsIndexedModel, ILcdIntegerIndexedModel
AbstractFeatureCollectionType
that implements ILcd2DBoundsIndexedModel
and ILcdIntegerIndexedModel
.ILcdModel.Query
Modifier and Type | Field and Description |
---|---|
static TLcdDataProperty |
BOUNDED_BY_PROPERTY
Data property that maps to the
boundedBy element. |
static TLcdDataProperty |
FEATURE_MEMBER_PROPERTY
Data property that maps to the
featureMember element. |
static TLcdDataProperty |
FEATURE_MEMBERS_PROPERTY
Data property that maps to the
featureMembers element. |
static TLcdDataProperty |
LOCATION_PROPERTY
Data property that maps to the
location element. |
DESCRIPTION_PROPERTY, DESCRIPTION_REFERENCE_PROPERTY, ID_PROPERTY, IDENTIFIER_PROPERTY, META_DATA_PROPERTY_PROPERTY, NAME_PROPERTY
FIRE_LATER, FIRE_NOW, NO_EVENT
Constructor and Description |
---|
TLcdGML32AbstractFeatureCollection(TLcdDataType aType) |
Modifier and Type | Method and Description |
---|---|
void |
addElement(java.lang.Object aElement,
int aEventMode)
Adds the specified element to this model.
|
void |
addElements(java.util.Vector aElements,
int aEventMode)
Adds all of the elements in the specified vector to this model.
|
void |
addHierarchyModelContainerListener(ILcdModelContainerListener aModelContainerListener) |
void |
addHierarchyModelListener(ILcdModelListener aModelListener) |
boolean |
addModel(ILcdModel aModel) |
void |
addModelContainerListener(ILcdModelContainerListener aModelContainerListener) |
void |
addModelListener(ILcdModelListener aArg0)
Registers the specified model listener to receive notifications of model changes on this model.
|
int |
applyOnInteract2DBounds(ILcdBounds aArg0,
boolean aArg1,
ILcdFunction aArg2,
double aArg3,
double aArg4)
Applies the specified function to all the model elements of which the 2D bounds overlap with the specified bounds.
|
int |
applyOnInteract2DBounds(ILcdBounds aArg0,
boolean aArg1,
ILcdFunction aArg2,
double aArg3,
double aArg4,
double aArg5,
double aArg6,
boolean aArg7)
Applies the specified function to all the elements of which the 2D bounds overlap with the specified bounds.
|
boolean |
canAddElement(java.lang.Object aElement)
Returns
true if the specified element can be added to this model, false otherwise. |
boolean |
canRemoveElement(java.lang.Object aElement)
Returns
true if the specified element can be removed from this model, false otherwise. |
TLcdGML32AbstractFeatureCollection |
clone()
Returns a deep clone of this object.
|
TLcdDataObject |
clone(java.util.Map aObjectDictionary)
Returns a deep clone of this object.
|
void |
dispose()
Disposes of this model and allows it to release any system resources that it is holding.
|
java.lang.Object |
elementAt(int aIndex)
Returns the element at the specified index.
|
void |
elementChanged(java.lang.Object aElement,
int aEventMode)
Notifies this model that the specified element has changed.
|
java.util.Enumeration |
elements()
Returns an enumeration over all elements of this model.
|
void |
elementsChanged(java.util.Vector aElements,
int aEventMode)
Notifies this model that the elements in the specified vector have changed.
|
void |
fireCollectedModelChanges()
Notifies all listeners that are registered on this model of all the changes that have been collected between the
previous notification and now.
|
TLcdGML32BoundingShape |
getBoundedBy()
Returns the value of the property that maps to the
boundedBy element. |
ILcdBounds |
getBounds()
Returns the
ILcdBounds by which the geometry of this ILcdBounded object
is bounded. |
java.util.List<TLcdGML32AbstractFeature> |
getFeatureMember()
Returns the value of the property that maps to the
featureMember element. |
java.util.List<TLcdGML32AbstractFeature> |
getFeatureMembers()
Returns the role value contained in the value of the
FEATURE_MEMBERS_PROPERTY property. |
java.lang.Object |
getLocation()
Returns the value of the property that maps to the
location element. |
ILcdModel |
getModel(int aIndex) |
ILcdModelDescriptor |
getModelDescriptor()
Returns the
ILcdModelDescriptor providing meta information about this model and
its elements. |
ILcdModelEncoder |
getModelEncoder()
Returns, if available, a model encoder that is capable of encoding this model,
(
encoder.canEncode(this) ), null otherwise. |
TLcdModelMetadata |
getModelMetadata()
Collects and returns metadata about the model.
|
ILcdModelReference |
getModelReference()
Returns the
ILcdModelReference describing how the geometry of the elements contained in this
model should be interpreted. |
java.lang.Object |
getValue(TLcdDataProperty aProperty)
Returns the value of the given property.
|
int |
indexOf(java.lang.Object aElement)
Returns the index of the first occurrence of the specified element in the model, or -1 if this model does not
contain the element.
|
int |
modelCount() |
void |
modelProduced(TLcdModelProducerEvent aModelProducerEvent) |
java.util.Enumeration |
models() |
void |
removeAllElements(int aEventMode)
Removes all elements from this model.
|
void |
removeElement(java.lang.Object aElement,
int aEventMode)
Removes the specified element from this model.
|
void |
removeElements(java.util.Vector aElements,
int aEventMode)
Removes all of the elements in the specified vector from this model.
|
void |
removeHierarchyModelContainerListener(ILcdModelContainerListener aModelContainerListener) |
void |
removeHierarchyModelListener(ILcdModelListener aModelListener) |
boolean |
removeModel(ILcdModel aModel) |
void |
removeModelContainerListener(ILcdModelContainerListener aModelContainerListener) |
void |
removeModelListener(ILcdModelListener aModelListener)
Unregisters the specified model listener so that it no longer receives notifications of model changes on this model.
|
void |
setBoundedBy(TLcdGML32BoundingShape aValue)
Sets the value of the property that maps to the
boundedBy element. |
void |
setFeatureMembers(java.util.List<TLcdGML32AbstractFeature> aValue)
Sets the value of the property that maps to the
featureMembers element. |
void |
setLocation(java.lang.Object aValue)
Sets the value of the property that maps to the
location element. |
void |
setModelDescriptor(TLcdGML32ModelDescriptor aModelDescriptor) |
void |
setModelReference(ILcdModelReference aModelReference) |
int |
size()
Returns the number of elements in this model.
|
collectShapes, contains2D, contains2D, contains3D, contains3D, getFocusPoint, getShape, getShapeCount, invalidateObject, shapesChanged
getDescription, getDescriptionReference, getId, getIdentifier, getMetaDataProperty, getName, setDescription, setDescriptionReference, setId, setIdentifier
getDataType, getValue, hasValue, hasValue, setValue, setValue, toString
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
query
close
public static final TLcdDataProperty FEATURE_MEMBER_PROPERTY
featureMember
element.
The possible values for this property are instances of List<TLcdGML32FeatureProperty>
.public static final TLcdDataProperty FEATURE_MEMBERS_PROPERTY
featureMembers
element.
The possible values for this property are instances of TLcdGML32FeatureArrayProperty
.public static final TLcdDataProperty BOUNDED_BY_PROPERTY
boundedBy
element.
The possible values for this property are instances of TLcdGML32BoundingShape
.public static final TLcdDataProperty LOCATION_PROPERTY
location
element.
The possible values for this property are instances of TLcdGML32LocationProperty
.public TLcdGML32AbstractFeatureCollection(TLcdDataType aType)
public java.lang.Object getValue(TLcdDataProperty aProperty)
ILcdDataObject
Returns 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 type
or in one of its super types.
Otherwise an IllegalArgumentException
is thrown.
getValue
in interface ILcdDataObject
getValue
in class TLcdDataObject
aProperty
- the property for which the value is to be returnedpublic void setModelReference(ILcdModelReference aModelReference)
public void setModelDescriptor(TLcdGML32ModelDescriptor aModelDescriptor)
public void addHierarchyModelContainerListener(ILcdModelContainerListener aModelContainerListener)
public void addHierarchyModelListener(ILcdModelListener aModelListener)
public void removeHierarchyModelContainerListener(ILcdModelContainerListener aModelContainerListener)
public void removeHierarchyModelListener(ILcdModelListener aModelListener)
public boolean addModel(ILcdModel aModel)
public void addModelContainerListener(ILcdModelContainerListener aModelContainerListener)
public ILcdModel getModel(int aIndex)
public int modelCount()
public java.util.Enumeration models()
public boolean removeModel(ILcdModel aModel)
public void removeModelContainerListener(ILcdModelContainerListener aModelContainerListener)
public void modelProduced(TLcdModelProducerEvent aModelProducerEvent)
public void addElement(java.lang.Object aElement, int aEventMode)
ILcdModel
Models that support this operation may place limitations on what elements may be added to this model. For example,
implementations that are based on a spatial indexing structure will require that elements implement
ILcdBounded
.
When adding an element, the user should make sure that canAddElement(aElement)
holds, and that the
element's geometry is expressed in the same model reference as this model. It is generally undefined what happens
if an invalid element is added.
Implementations of this interface should clearly specify in their documentation any restrictions on what elements
may be added. Although it is unspecified what happens if the preconditions are not met, implementations are
encouraged to throw meaningful exceptions (for example, NullPointerException, IllegalArgumentException,
ClassCastException, UnsupportedOperationException
), whenever possible.
addElement
in interface ILcdModel
aElement
- the element to be added to this model.aEventMode
- the mode for sending out the model change event. This can be FIRE_LATER
or NO_EVENT
.ILcdModel.canAddElement(Object)
public void addElements(java.util.Vector aElements, int aEventMode)
ILcdModel
ILcdBounded
. Implementations of this interface should clearly specify in their documentation any
restrictions on what elements may be added.
The behavior of this operation is undefined if the specified vector is modified while the operation is in progress.
The specified elements will be added to this model in the order they are specified in the vector. If an element cannot be added, this method will return at the first failure. Succeeding elements won't be added.
Although it is unspecified what happens if the preconditions are not met, implementations are encouraged to
throw meaningful exceptions (for example, NullPointerException, IllegalArgumentException, ClassCastException,
UnsupportedOperationException
), whenever possible.
addElements
in interface ILcdModel
aElements
- the vector of elements to be added to this model.aEventMode
- the mode for sending the model change events This can be FIRE_LATER
or NO_EVENT
.ILcdModel.canAddElement(Object)
public void addModelListener(ILcdModelListener aArg0)
ILcdModel
Registers the specified model listener to receive notifications of model changes on this model.
Model changes are sent out when an element has been added, removed or changed. Model changes can be sent out
individually, grouped or silently applied without notifications, depending on the ILcdFireEventMode
that was specified with the change.
In case you need to register a listener which keeps a reference to an object with a shorter life-time than this model,
you can use a ALcdWeakModelListener
instance as model listener.
addModelListener
in interface ILcdModel
aArg0
- the ILcdModelListener
to register on this model.ILcdModel.removeModelListener(com.luciad.model.ILcdModelListener)
,
ILcdModelListener
public int applyOnInteract2DBounds(ILcdBounds aArg0, boolean aArg1, ILcdFunction aArg2, double aArg3, double aArg4, double aArg5, double aArg6, boolean aArg7)
ILcd2DBoundsInteractable
false
for an element it was applied on.applyOnInteract2DBounds
in interface ILcd2DBoundsIndexedModel
applyOnInteract2DBounds
in interface ILcd2DBoundsInteractable
aArg0
- the rectangle to test overlap with.aArg1
- if false
, the spatial search may return more elements than the ones strictly
overlapping; if true
, the search only returns the elements that are
overlapping. The latter mode is more precise, but it may be slower.aArg2
- the function to apply on each element that overlaps with the given bounds.aArg3
- the precision required in the x dimension, expressed in model units.
For example, for a cartesian grid system expressed in meters, the values
should be expressed in meters as well, for a geodetic coordinate system the accuracy
values should be expressed in degrees.
The precision is useful in combination with multi-leveled data (multiple representations of the same object, but with varying accuracy), so that the most appropriate accuracy level can be used. 0 means best possible accuracy, but it might trigger lazy-loaded implementations to load lots of data.
aArg4
- the precision required in the y dimension, expressed in model units.aArg5
- the minimal element size in the x dimension (as in
ILcdBounds.getWidth()
), expressed in model units.
Elements that are smaller than this size will be skipped. This may, for example, be
useful when improving the efficiency of painting elements by skipping elements
that are smaller than some threshold (e.g. one pixel, converted to model units).aArg6
- the minimal element size in the y dimension (as in
ILcdBounds.getHeight()
), expressed in model units.aArg7
- if true
, zero-sized elements (points) are considered as well, even though they
might be smaller than the minimum size.ILcdFunction
has been applied.public int applyOnInteract2DBounds(ILcdBounds aArg0, boolean aArg1, ILcdFunction aArg2, double aArg3, double aArg4)
ILcd2DBoundsIndexedModel
false
.applyOnInteract2DBounds
in interface ILcd2DBoundsIndexedModel
aArg0
- the rectangle to test overlap with.aArg1
- if false
, the spatial search may return more elements than the ones strictly
overlapping; if true
, the search only returns the elements that are
overlapping. The latter mode is more precise, but it may be slower.aArg2
- the function to apply on each element that overlaps with the given bounds.
The return value of the specified function is used as a stop criterion: the spatial query is interrupted
if the function returns false
.aArg3
- the precision required in the x dimension, expressed in model units.
For example, for a cartesian grid system expressed in meters, the values
should be expressed in meters as well, for a geodetic coordinate system the accuracy
values should be expressed in degrees.
The precision is useful in combination with multi-leveled data (multiple representations of the same object, but with varying accuracy), so that the most appropriate accuracy level can be used. 0 means best possible accuracy, but it might trigger lazy-loaded implementations to load lots of data.
aArg4
- the precision required in the y dimension, expressed in model units.ILcdFunction
has been applied.public java.lang.Object elementAt(int aIndex)
ILcdIntegerIndexedModel
elementAt
in interface ILcdIntegerIndexedModel
aIndex
- an index into this ILcdModel
.public int size()
ILcdIntegerIndexedModel
size
in interface ILcdIntegerIndexedModel
public int indexOf(java.lang.Object aElement)
ILcdIntegerIndexedModel
i
for which this.elementAt(i).equals(aElement)
.indexOf
in interface ILcdIntegerIndexedModel
aElement
- the element to search for.public boolean canAddElement(java.lang.Object aElement)
ILcdModel
true
if the specified element can be added to this model, false
otherwise.
Note that this method generally does not validate whether the specified element is expressed in the same model reference as this model. It is the responsibility of the user of this model to make sure this precondition is fulfilled when an element is added to this model.
canAddElement
in interface ILcdModel
aElement
- the element to be verified.true
if the specified element can be added to this model, false
otherwise.public ILcdModelReference getModelReference()
ILcdModel
ILcdModelReference
describing how the geometry of the elements contained in this
model should be interpreted.getModelReference
in interface ILcdModel
ILcdModelReference
of this ILcdModel
.public ILcdModelDescriptor getModelDescriptor()
ILcdModel
ILcdModelDescriptor
providing meta information about this model and
its elements.getModelDescriptor
in interface ILcdModel
ILcdModelDescriptor
of this ILcdModel
. Should not be null
.public ILcdModelEncoder getModelEncoder()
ILcdModel
encoder.canEncode(this)
), null
otherwise.getModelEncoder
in interface ILcdModel
null
otherwise.public TLcdModelMetadata getModelMetadata()
ILcdModel
TLcdModelMetadata
instance every time it is called.
The default implementation uses TLcdModelMetadata.Builder.fromModel(com.luciad.model.ILcdModel)
.
Implementations can recreate
or extend
the metadata.
The following example adds a data category and source file mime type:
public TLcdModelMetadata getModelMetadata() {
String source = this.getModelDescriptor().getSourceName();
return this.getModelMetadata().asBuilder()
.entryPoint(new TLcdModelMetadata.Source(source, MIME_XML))
.addDataCategory(TLcdModelMetadata.DataCategory.VECTOR)
.build();
}
getModelMetadata
in interface ILcdModel
public java.util.Enumeration elements()
ILcdModel
public void removeElement(java.lang.Object aElement, int aEventMode)
ILcdModel
Although it is unspecified what happens if the preconditions are not met, implementations are encouraged to
throw meaningful exceptions (for example, NullPointerException, IllegalArgumentException, ClassCastException,
UnsupportedOperationException
), whenever possible.
removeElement
in interface ILcdModel
aElement
- the element to be removed from this model.aEventMode
- the mode for sending out the model change event. This can be FIRE_LATER
or NO_EVENT
.ILcdModel.canRemoveElement(Object)
public boolean canRemoveElement(java.lang.Object aElement)
ILcdModel
true
if the specified element can be removed from this model, false
otherwise.
Note that this method generally does not check whether the specified element is actually contained in this model.canRemoveElement
in interface ILcdModel
aElement
- the element to be verified.true
if the specified element can be removed from this model, false
otherwise.public void removeElements(java.util.Vector aElements, int aEventMode)
ILcdModel
The behavior of this operation is undefined if the specified vector is modified while the operation is in progress.
The specified elements will be removed from this model in the order they are specified in the vector. If an element cannot be removed, this method will return at the first failure. Succeeding elements won't be removed.
Although it is unspecified what happens if the preconditions are not met, implementations are encouraged to
throw meaningful exceptions (for example, NullPointerException, IllegalArgumentException, ClassCastException,
UnsupportedOperationException
), whenever possible.
removeElements
in interface ILcdModel
aElements
- the vector of elements to be removed from this model.aEventMode
- the mode for sending out the model change event. This can be FIRE_LATER
or NO_EVENT
.ILcdModel.canRemoveElement(Object)
public void removeAllElements(int aEventMode)
ILcdModel
If an element cannot be removed, this method will return at the first failure. Succeeding elements won't be removed.
Although it is unspecified what happens if the preconditions are not met, implementations are encouraged to
throw meaningful exceptions (for example, NullPointerException, IllegalArgumentException, ClassCastException,
UnsupportedOperationException
), whenever possible.
removeAllElements
in interface ILcdModel
aEventMode
- the mode for sending out the model change event. This can be FIRE_LATER
or NO_EVENT
.public void elementChanged(java.lang.Object aElement, int aEventMode)
ILcdModel
elementChanged
in interface ILcdModel
aElement
- the element that has changed.aEventMode
- the mode for sending out the model change event. This can be FIRE_LATER
or NO_EVENT
.public void elementsChanged(java.util.Vector aElements, int aEventMode)
ILcdModel
elementsChanged
in interface ILcdModel
aElements
- the vector of elements that have changed.aEventMode
- the mode for sending out the model change event. This can be FIRE_LATER
or NO_EVENT
.public void fireCollectedModelChanges()
ILcdModel
fireCollectedModelChanges
in interface ILcdModel
ILcdModelListener.modelChanged(TLcdModelChangedEvent)
public void removeModelListener(ILcdModelListener aModelListener)
ILcdModel
removeModelListener
in interface ILcdModel
aModelListener
- the ILcdModelListener
to remove.ILcdModel.addModelListener(com.luciad.model.ILcdModelListener)
,
ILcdModelListener
public void dispose()
ILcdModel
finalize
) on this model subsequent to a call to
this method is undefined.dispose
in interface ILcdModel
dispose
in interface ILcdDisposable
public TLcdGML32AbstractFeatureCollection clone()
TLcdDataObject
TLcdDataObject.clone(Map)
.clone
in interface ILcdCloneable
clone
in class TLcdGML32AbstractFeature
Object.clone()
public TLcdDataObject clone(java.util.Map aObjectDictionary)
TLcdDataObject
ILcdDataObject
, the value is cloned by first creating a new instance via
the value.getDataType().newInstance()
method, and then cloning its properties one by one.ILcdDeepCloneable
or
ILcdCloneable
then this interface is used to clone the value.clone
in interface ILcdDeepCloneable
clone
in class TLcdGML32AbstractFeature
aObjectDictionary
- the Object dictionary that keeps track of the objects for which a clone has already been made,
and their corresponding clone Object.public ILcdBounds getBounds()
ILcdBounded
ILcdBounds
by which the geometry of this ILcdBounded
object
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 undefined
bounds.
You can create undefined bounds using the default constructors
of TLcdLonLatBounds
or TLcdXYBounds
.
getBounds
in interface ILcdBounded
getBounds
in class TLcdGML32AbstractFeature
ILcdBounds
by which the geometry of this ILcdBounded
object
is bounded.public java.util.List<TLcdGML32AbstractFeature> getFeatureMember()
featureMember
element.FEATURE_MEMBER_PROPERTY
property.List
public java.util.List<TLcdGML32AbstractFeature> getFeatureMembers()
FEATURE_MEMBERS_PROPERTY
property. Returns null
if the value of the FEATURE_MEMBERS_PROPERTY
property is null
.FEATURE_MEMBERS_PROPERTY
property.TLcdGML32FeatureArrayProperty
public void setFeatureMembers(java.util.List<TLcdGML32AbstractFeature> aValue)
featureMembers
element. to a new instance of the association class TLcdGML32FeatureArrayProperty
initialized with the given role value. In case the given role value is null
, the FEATURE_MEMBERS_PROPERTY
property is set to null
.aValue
- the role value to set for the FEATURE_MEMBERS_PROPERTY
property.public TLcdGML32BoundingShape getBoundedBy()
boundedBy
element.
This property describes the minimum bounding box or rectangle that encloses the entire feature.
BOUNDED_BY_PROPERTY
property.public void setBoundedBy(TLcdGML32BoundingShape aValue)
boundedBy
element.
This property describes the minimum bounding box or rectangle that encloses the entire feature.
aValue
- the value to set for the BOUNDED_BY_PROPERTY
property.public java.lang.Object getLocation()
location
element.LOCATION_PROPERTY
property.TLcdGML32LocationProperty
public void setLocation(java.lang.Object aValue)
location
element.aValue
- the value to set for the LOCATION_PROPERTY
property.