public abstract class AbstractFeatureSet extends AbstractIndexedVisitable implements FeatureSet
Modifier and Type | Field and Description |
---|---|
protected static Logger |
LOG |
Constructor and Description |
---|
AbstractFeatureSet() |
Modifier and Type | Method and Description |
---|---|
void |
accept(Visitor visitor,
long firstValueIndex,
long elements) |
protected void |
doAccept(Visitor visitor,
long firstValueIndex)
Provides each value of this container to the provided
Visitor . |
protected void |
doAccept(Visitor visitor,
long firstValueIndex,
long elements) |
DisposableIterator |
fastIterator()
Returns a fast iterator over this set.
|
Feature |
first()
Return the first feature of the set.
|
DynObjectSet |
getDynObjectSet()
Returns a
DynObjectSet of the contents of this set. |
DynObjectSet |
getDynObjectSet(boolean fast)
Returns a
DynObjectSet of the contents of this set. |
abstract FeatureStore |
getFeatureStore() |
boolean |
isEmpty()
Indicates whether this FeatureSet contains zero features.
|
boolean |
isFromStore(DataStore store)
Indicates whether this DataSet belongs to a specific store
|
DisposableIterator |
iterator()
Returns an iterator over the elements in this collection, in the order
(if any) defined when the collection was obtained.
|
accept, doAccept
accept
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
accept, delete, fastIterator, fastIterator, getDefaultFeatureType, getFeatureTypes, getSize, insert, iterator, iterator, update
dispose
public abstract FeatureStore getFeatureStore()
public final void accept(Visitor visitor, long firstValueIndex, long elements) throws BaseException
accept
in interface FeatureSet
BaseException
protected void doAccept(Visitor visitor, long firstValueIndex) throws VisitCanceledException, BaseException
AbstractIndexedVisitable
Visitor
.
The VisitCanceledException
will be managed by the parent
AbstractIndexedVisitable
class, so simply throw it.doAccept
in class AbstractIndexedVisitable
VisitCanceledException
BaseException
protected void doAccept(Visitor visitor, long firstValueIndex, long elements) throws VisitCanceledException, BaseException
VisitCanceledException
BaseException
public Feature first()
FeatureSet
first
in interface FeatureSet
public boolean isEmpty() throws DataException
FeatureSet
isEmpty
in interface FeatureSet
DataException
public DisposableIterator fastIterator() throws DataException
FeatureSet
Fast 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 FeatureSet
DataException
DataSet.accept(org.gvsig.tools.visitor.Visitor)
,
FeatureSet.accept(org.gvsig.tools.visitor.Visitor, long)
public DisposableIterator iterator()
FeatureSet
iterator
in interface FeatureSet
DataSet.accept(org.gvsig.tools.visitor.Visitor)
,
FeatureSet.accept(org.gvsig.tools.visitor.Visitor, long)
,
FeatureSet.fastIterator()
,
FeatureSet.fastIterator(long)
public DynObjectSet getDynObjectSet()
FeatureSet
DynObjectSet
of the contents of this set.
Defaults to fast iteration.getDynObjectSet
in interface FeatureSet
DynObjectSet
public DynObjectSet getDynObjectSet(boolean fast)
FeatureSet
DynObjectSet
of the contents of this set.getDynObjectSet
in interface FeatureSet
fast
- if the set will be able to be iterated in a fast way, by
reusing the DynObject
instance for each
Feature
instance.DynObjectSet
public boolean isFromStore(DataStore store)
DataSet
isFromStore
in interface DataSet
store
- a DataStore