public class IndexFeatureSet extends AbstractFeatureSet implements FeatureSet, FeatureSetProvider, java.lang.Iterable<Feature>
| Modifier and Type | Class and Description |
|---|---|
class |
IndexFeatureSet.FastIndexIterator |
class |
IndexFeatureSet.IndexIterator |
LOGEMPTY_FEATURESET| Constructor and Description |
|---|
IndexFeatureSet(FeatureIndexProviderServices index,
LongList featureReferences) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canFilter() |
boolean |
canIterateFromIndex() |
boolean |
canOrder() |
void |
commitChanges() |
void |
delete(Feature feature)
Deletes a
Feature from this FeatureSet. |
void |
dispose()
Disposes the current object, to allow it to close and dispose any used
resources.
|
DisposableIterator |
fastIterator(long index)
Returns a fast iterator over this set, starting from the given index.
|
DisposableIterator |
fastIterator(long index,
long elements)
Returns an iterator over the elements in this set, in the order
(if any) defined when the collection was obtained.
|
FeatureType |
getDefaultFeatureType()
Returns the default
FeatureType of this FeatureSet. |
FeatureStore |
getFeatureStore() |
java.util.List |
getFeatureTypes()
Returns a list of the
FeatureType(s) in this FeatureSet. |
long |
getSize()
Returns the number of
Feature(s) contained in this FeatureSet. |
void |
insert(EditableFeature feature)
Inserts a new feature in this set.
|
boolean |
isEmpty() |
DisposableIterator |
iterator(long index)
Returns an iterator over the elements in this collection, in the order
(if any) defined when the collection was obtained.
|
DisposableIterator |
iterator(long index,
long elements)
Returns an iterator over the elements in this set, in the order
(if any) defined when the collection was obtained.
|
void |
update(EditableFeature feature)
Updates a
Feature with the given EditableFeature. |
accept, doAccept, doAccept, fastIterator, first, getDynObjectSet, getDynObjectSet, isFromStore, iterable, iterable, iterator, makeFilter, size, size64, toJson, toJSON, toJsonBuilderaccept, doAcceptacceptclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaccept, accept, fastIterator, first, getDynObjectSet, getDynObjectSet, iterable, iterable, iterator, makeFilter, toJson, toJSON, toJsonBuilderaccept, isFromStoreisEmpty, isEmpty, isEmptyQuietlyfastIterator, iteratorpublic IndexFeatureSet(FeatureIndexProviderServices index, LongList featureReferences)
public boolean canFilter()
canFilter in interface FeatureSetProviderpublic boolean canIterateFromIndex()
canIterateFromIndex in interface FeatureSetProviderpublic boolean canOrder()
canOrder in interface FeatureSetProviderpublic DisposableIterator fastIterator(long index) throws DataException
FeatureSetFast in this case means that each of the elements returned may be a reused or pooled object instance, so don't use it to be stored in any way.
If you need to store one of the Feature of the iterator, use the
Feature.getCopy() to create a clone of the object.
NOTE: if you use this method to get the iterator, you
must get sure the iterator is disposed (@see
Disposable.dispose()) in any case, even if an error
occurs while getting the data. It is recommended to use the
accept methods instead, which handle everything for you.
Take into account the accept methods may use a fast iterator to get the
features.
fastIterator in interface FeatureSetindex - position in which the iterator is initially located.DataExceptionDataSet.accept(org.gvsig.tools.visitor.Visitor),
FeatureSet.accept(org.gvsig.tools.visitor.Visitor, long)public DisposableIterator fastIterator(long index, long elements) throws DataException
FeatureSetProviderfastIterator in interface FeatureSetfastIterator in interface FeatureSetProviderindex - index of first element to be returned from the iterator (by a
call to the next method).DataException - if there is an error getting the iteratorFeatureSetProvider.fastIterator(),
#fastIterator(long)public long getSize()
throws DataException
FeatureSetFeature(s) contained in this FeatureSet.
The value returned by this method won't be accurate when the FeatureStore
is being edited and this set's features are modified, added or deleted.getSize in interface FeatureSetgetSize in interface FeatureSetProviderFeature(s) contained in this FeatureSet.DataExceptionpublic boolean isEmpty()
isEmpty in interface FeatureSetProviderisEmpty in interface IsEmptyisEmpty in class AbstractFeatureSetpublic DisposableIterator iterator(long index) throws DataException
FeatureSet
NOTE: if you use this method to get the iterator, you
must get sure the iterator is disposed (@see
Disposable.dispose()) in any case, even if an error
occurs while getting the data. It is recommended to use the
accept methods instead, which handle everything for you.
Take into account the accept methods may use a fast iterator to get the
features.
iterator in interface FeatureSetindex - index of first element to be returned from the iterator (by
a call to the next method).DataException - if the index is out of range (index < 0 || index
> size()).DataSet.accept(org.gvsig.tools.visitor.Visitor),
FeatureSet.accept(org.gvsig.tools.visitor.Visitor, long),
FeatureSet.fastIterator(),
FeatureSet.fastIterator(long)public DisposableIterator iterator(long index, long elements) throws DataException
FeatureSetProviderFast in this case means that each of the elements returned may be a reused or pooled object instance, so don't use it to be stored in any way.
If you need to store one of the FeatureProvider of the iterator,
use the FeatureProvider.getCopy() to create a clone of the
object.
iterator in interface FeatureSetiterator in interface FeatureSetProviderindex - index of first element to be returned from the iterator (by a
call to the next method).DataException - if there is an error getting the iteratorpublic void delete(Feature feature) throws DataException
FeatureSetFeature from this FeatureSet.DisposableIterator from this store that was still in use will
be
unsafe. Use Iterator.remove() instead.delete in interface FeatureSetfeature - the Feature to delete.DataExceptionpublic void commitChanges()
throws DataException
commitChanges in interface FeatureSetDataExceptionpublic FeatureType getDefaultFeatureType()
FeatureSetFeatureType of this FeatureSet.getDefaultFeatureType in interface FeatureSetFeatureType in this FeatureSet.public java.util.List getFeatureTypes()
FeatureSetFeatureType(s) in this FeatureSet.getFeatureTypes in interface FeatureSetFeatureType(s) in this FeatureSet.public void insert(EditableFeature feature) throws DataException
FeatureSetEditableFeature as it has not been stored yet.DisposableIterator from this store that was still in use can
will not reflect this change.insert in interface FeatureSetfeature - the EditableFeature to insert.DataExceptionpublic void update(EditableFeature feature) throws DataException
FeatureSetFeature with the given EditableFeature.DisposableIterator from this store that was still in use can
will not reflect this change.update in interface FeatureSetfeature - an instance of EditableFeature with which to
update the associated Feature.DataExceptionpublic void dispose()
DisposableNOTE:After calling this method, the object may not be usable anymore.
dispose in interface Disposablepublic FeatureStore getFeatureStore()
getFeatureStore in interface FeatureSetgetFeatureStore in class AbstractFeatureSet