Class PirolFeatureCollection
java.lang.Object
org.openjump.core.apitools.objecttyperoles.PirolFeatureCollection
- All Implemented Interfaces:
FeatureCollection, Iterable<Feature>, ObjectContainingMetaInformation
public class PirolFeatureCollection
extends Object
implements FeatureCollection, ObjectContainingMetaInformation
Class that wraps a FeatureDataset and adds methods to get and set meta information objects.
- Version:
- $Rev: 1654 $
- Author:
- Ole Rahn
FH Osnabrück - University of Applied Sciences Osnabrück,
Project: PIROL (2005),
Subproject: Daten- und Wissensmanagement - See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FeatureCollectionprotected MetaDataMapprotected FeatureCollectionRole[] -
Constructor Summary
ConstructorsConstructorDescriptionConstructor - for java2xml, only!!PirolFeatureCollection(FeatureCollection featureDataSet, FeatureCollectionRole initRole) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a feature to this collection.voidaddAll(Collection features) Adds multiple features to this collection.voidaddRole(FeatureCollectionRole role) voidfor java2xmlvoidclear()Removes all features from this collection.booleanprotected voidfinalize()org.locationtech.jts.geom.EnvelopeReturns the bounds of this collection.for java2xmlReturns an unmodifiable List of the features in this collectionReturns information about this FeatureCollectiongetRole(int roleId) Check if this FeatureCollection has a role with the given IDgetRole(FeatureCollectionRole role) Check if this FeatureCollection has a role like the given oneCheck if this FeatureCollection has a role like the given onegetRoles()the PirolFeatureCollection is a wrapper for other feature collections in some cases one might want to work with the original FC.for java2xmlinthashCode()voidinvalidateEnvelope(boolean simpleInvalidation) booleanisEmpty()Returns whether this collection has no features.iterator()Returns an Iterator over the featuresquery(org.locationtech.jts.geom.Envelope envelope) A quick search for features, using an envelope comparison.voidRemoves a feature from this collection.remove(org.locationtech.jts.geom.Envelope env) Removes the features which intersect the given envelopevoidremoveAll(Collection features) Removes multiple features from this collection.voidvoidsetFeatureDataSet(FeatureCollection featureDataSet) for java2xmlvoidsetMetaInformation(MetaDataMap metaInformation) intsize()Returns the number of features in this collection.Feature[]toArray()toString()Methods inherited from interface Iterable
forEach, spliterator
-
Field Details
-
featureDataSet
-
metaInformation
-
roles
-
-
Constructor Details
-
PirolFeatureCollection
-
PirolFeatureCollection
public PirolFeatureCollection()Constructor - for java2xml, only!!
-
-
Method Details
-
getXmlRoles
for java2xml -
addXmlRole
for java2xml -
getFeatureDataSet
for java2xml -
setFeatureDataSet
for java2xml -
addRole
-
removeRole
-
getRoles
-
getRole
Check if this FeatureCollection has a role like the given one- Parameters:
role- the role to check for- Returns:
- the role if this FeatureCollection has a role like the given one, else null
- See Also:
-
getRole
Check if this FeatureCollection has a role like the given one- Parameters:
role- the role to check for- Returns:
- the role if this FeatureCollection has a role like the given one, else null
- See Also:
-
getRole
Check if this FeatureCollection has a role with the given ID- Parameters:
roleId- id of the role type to check for- Returns:
- the role if this FeatureCollection has a role with the given ID, else null
- See Also:
-
getMetaInformation
- Specified by:
getMetaInformationin interfaceObjectContainingMetaInformation
-
setMetaInformation
- Specified by:
setMetaInformationin interfaceObjectContainingMetaInformation
-
invalidateEnvelope
public void invalidateEnvelope(boolean simpleInvalidation) -
add
Description copied from interface:FeatureCollectionAdds a feature to this collection.- Specified by:
addin interfaceFeatureCollection- Parameters:
feature- a Feature to add to the end of this collection
-
addAll
Description copied from interface:FeatureCollectionAdds multiple features to this collection. To be preferred over #add for adding multiple features, because in some systems (like the JUMP Workbench) fewer events will be fired.- Specified by:
addAllin interfaceFeatureCollection
-
clear
public void clear()Description copied from interface:FeatureCollectionRemoves all features from this collection.- Specified by:
clearin interfaceFeatureCollection
-
equals
-
getEnvelope
public org.locationtech.jts.geom.Envelope getEnvelope()Description copied from interface:FeatureCollectionReturns the bounds of this collection.- Specified by:
getEnvelopein interfaceFeatureCollection- Returns:
- the smallest Envelope enclosing all the Features in this collection
-
getFeatures
Description copied from interface:FeatureCollectionReturns an unmodifiable List of the features in this collection- Specified by:
getFeaturesin interfaceFeatureCollection- Returns:
- a read-only view of all the features
-
getFeatureSchema
Description copied from interface:FeatureCollectionReturns information about this FeatureCollection- Specified by:
getFeatureSchemain interfaceFeatureCollection- Returns:
- the types of the attributes of the features in this collection
-
hashCode
-
isEmpty
public boolean isEmpty()Description copied from interface:FeatureCollectionReturns whether this collection has no features.- Specified by:
isEmptyin interfaceFeatureCollection- Returns:
- whether or not the size of this collection is 0
-
iterator
Description copied from interface:FeatureCollectionReturns an Iterator over the features- Specified by:
iteratorin interfaceFeatureCollection- Specified by:
iteratorin interfaceIterable<Feature>- Returns:
- an Iterator over the features
-
query
Description copied from interface:FeatureCollectionA quick search for features, using an envelope comparison.- Specified by:
queryin interfaceFeatureCollection- Parameters:
envelope- the envelope to query against- Returns:
- features whose envelopes intersect the given envelope
-
remove
Description copied from interface:FeatureCollectionRemoves the features which intersect the given envelope- Specified by:
removein interfaceFeatureCollection- Returns:
- the removed features
-
remove
Description copied from interface:FeatureCollectionRemoves a feature from this collection.- Specified by:
removein interfaceFeatureCollection- Parameters:
feature- a Feature to remove from this collection
-
removeAll
Description copied from interface:FeatureCollectionRemoves multiple features from this collection. To be preferred over #remove for removing multiple features, because in some systems (like the JUMP Workbench) fewer events will be fired.- Specified by:
removeAllin interfaceFeatureCollection
-
size
public int size()Description copied from interface:FeatureCollectionReturns the number of features in this collection.- Specified by:
sizein interfaceFeatureCollection- Returns:
- the number of features in this collection
-
toString
-
toArray
-
finalize
-
getWrappee
the PirolFeatureCollection is a wrapper for other feature collections in some cases one might want to work with the original FC. Therefor you can use this method.- Returns:
- the feature collection wrapped by this PirolFeatureCollection
-