public class FeatureCollection extends Object implements IFeatureCollection
| Constructor and Description |
|---|
FeatureCollection(IFeatureMetadata featureMetadata)
Constructs a feature collection with the supplied data.
|
FeatureCollection(String description,
IFeatureMetadata featureMetadata)
Constructs a feature collection with the supplied data.
|
FeatureCollection(String description,
IFeatureMetadata featureMetadata,
Collection names,
Metadata metadata)
Constructs a feature collection with the supplied data.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(IFeature feature)
Adds the specified feature to this feature collection or throws an UnsupportedOperationException if this feature
collection does not support adding a feature.
|
void |
clear()
Removes all features from this feature collection.
|
IFeature |
get(int index)
Returns the feature at the specified index.
|
long |
getCount()
Returns the number of features in this collection.
|
Metadata |
getCustomMetadata()
Contains additional metadata associated with the
feature collection.
|
String |
getDescription()
Contains a textual description of the feature collection.
|
IFeatureCollectionMetadata |
getMetadata()
Accesses the metadata that describes this feature collection.
|
Collection |
getNames()
A collection of names used to identify the feature collection.
|
boolean |
isReadOnly()
Indicates if the feature collection is read only.
|
boolean |
isTransient()
Indicates if this
IFeatureCollection is transient. |
IFeatureIterator |
iterator()
Returns an iterator for accessing each of the
IFeature instances
contained within this feature collection. |
void |
remove(IFeature feature)
Removes the specified feature from this collection.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddAll, removeAllpublic FeatureCollection(String description, IFeatureMetadata featureMetadata, Collection names, Metadata metadata)
description - Description for the IFeatureCollectionMetadata.featureMetadata - Feature metadata for features in this collection.names - Names collection for the IFeatureCollectionMetadata.metadata - Additional metadata associated with IFeatureCollectionMetadata.public FeatureCollection(String description, IFeatureMetadata featureMetadata)
description - Description for the IFeatureCollectionMetadata.featureMetadata - Feature metadata for features in this collection.public FeatureCollection(IFeatureMetadata featureMetadata)
featureMetadata - Feature metadata for features in this collection.public Collection getNames()
Strings containing the names. The value may be
an empty collection if no names are defined but will not return null.public String getDescription()
public Metadata getCustomMetadata()
public long getCount()
public IFeature get(int index)
index - The index of the feature to be returned.public boolean isReadOnly()
IFeatureCollectionisReadOnly in interface IFeatureCollectiontrue if this feature collection denies edits;
false otherwise.public IFeatureIterator iterator()
IFeatureCollectionIFeature instances
contained within this feature collection.
Feature collections that are backed by database management system
or other data access technology may have to build and execute a SQL statement
such as "Select * From ..." to provide access to the features. If this is the case,
it is important to always dispose of the IFeatureIterator. Refer to
the IFeatureIterator.dispose() documentation for more details.iterator in interface IFeatureCollectionpublic boolean isTransient()
IFeatureCollectionIFeatureCollection is transient. An instance of
IFeatureCollection may have a lifetime that is controlled by an
iterator, cursor, or other entity. A typical occurrence of transient features
occurs when searching a database table. The feature iterator used to return the
data in the result set returns IFeatureCollection instances whose data is connected
to the memory of the cursor. When the next feature is accessed, the same memory is
reused, thus making the previous feature invalid. These features are said to be
transient.
There is no guarantee that repositioning a cursor returns the same
feature each time, however, even if different feature instances are returned, the previous
feature instance should be assumed to be invalid and cannot be accessed.
Transient does not have any relationship to the editability of the data. Features,
feature collections, and tables may be edited even if they are designated as transient.
Transient simply refers to the lifetime of the IFeatureCollection and whether
or not its memory may be reclaimed or reused as the result of some other action such as
advancing an iterator or cursor.isTransient in interface IFeatureCollectiontrue if this feature is transient; false otherwise.public IFeatureCollectionMetadata getMetadata()
getMetadata in interface IFeatureCollectionIFeatureCollectionMetadata.IFeatureCollectionMetadata.getEnvelope(String)public void add(IFeature feature)
IFeatureCollectionThe default implementation throws an UnsupportedOperationException.
add in interface IFeatureCollectionfeature - the feature to add to this feature collection.public void remove(IFeature feature)
IFeatureCollectionThe default implementation throws an UnsupportedOperationException.
remove in interface IFeatureCollectionfeature - the feature to remove from the collection.public void clear()
IFeatureCollectionThe default implementation throws an UnsupportedOperationException.
clear in interface IFeatureCollection© 2007, 2022 Precisely. All rights reserved.