public abstract class AbstractFeatureSet extends AbstractIndexedVisitable implements FeatureSet
Modifier and Type | Field and Description |
---|---|
protected static Logger |
LOG |
EMPTY_FEATURESET
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() |
boolean |
isFromStore(DataStore store)
Indicates whether this DataSet belongs to a specific store
|
DisposableFeatureSetIterable |
iterable() |
DisposableFeatureSetIterable |
iterable(boolean disposeFeatureSet) |
DisposableIterator |
iterator()
Returns an iterator over the elements in this collection, in the order
(if any) defined when the collection was obtained.
|
Expression |
makeFilter(int maxfeatures) |
int |
size() |
long |
size64() |
JsonArray |
toJson() |
JsonArray |
toJSON()
Deprecated.
|
JsonArrayBuilder |
toJsonBuilder() |
accept, doAccept
accept
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
accept, commitChanges, delete, fastIterator, fastIterator, getDefaultFeatureType, getFeatureTypes, getSize, insert, iterator, iterator, update
dispose
isEmpty, isEmpty, isEmptyQuietly
public abstract FeatureStore getFeatureStore()
getFeatureStore
in interface FeatureSet
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 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 java.lang.Iterable<Feature>
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 DisposableFeatureSetIterable iterable()
iterable
in interface FeatureSet
public DisposableFeatureSetIterable iterable(boolean disposeFeatureSet)
iterable
in interface FeatureSet
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 DataStorepublic JsonArray toJson()
toJson
in interface FeatureSet
public JsonArrayBuilder toJsonBuilder()
toJsonBuilder
in interface FeatureSet
@Deprecated public JsonArray toJSON()
toJSON
in interface FeatureSet
public Expression makeFilter(int maxfeatures)
makeFilter
in interface FeatureSet