org.openjump.core.apitools.objecttyperoles
Class PirolFeatureCollection

java.lang.Object
  extended by org.openjump.core.apitools.objecttyperoles.PirolFeatureCollection
All Implemented Interfaces:
FeatureCollection, ObjectContainingMetaInformation

public class PirolFeatureCollection
extends java.lang.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:
de.fho.jump.pirol.utilities.metaData.MetaInformationHandler#createPirolFeatureCollection(FeatureCollection)

Field Summary
protected  FeatureCollection featureDataSet
           
protected  MetaDataMap metaInformation
           
protected  FeatureCollectionRole[] roles
           
 
Constructor Summary
PirolFeatureCollection()
          Constructor - for java2xml, only!!
PirolFeatureCollection(FeatureCollection featureDataSet, FeatureCollectionRole initRole)
           
 
Method Summary
 void add(Feature feature)
          Adds a feature to this collection.
 void addAll(java.util.Collection features)
          Adds multiple features to this collection.
 void addRole(FeatureCollectionRole role)
           
 void addXmlRole(FeatureCollectionRole role)
          for java2xml
 void clear()
          Removes all features from this collection.
 boolean equals(java.lang.Object arg0)
           
protected  void finalize()
           
 com.vividsolutions.jts.geom.Envelope getEnvelope()
          Returns the bounds of this collection.
 FeatureCollection getFeatureDataSet()
          for java2xml
 java.util.List getFeatures()
          Returns an unmodifiable List of the features in this collection
 FeatureSchema getFeatureSchema()
          Returns information about this FeatureCollection
 MetaDataMap getMetaInformation()
           
 FeatureCollectionRole getRole(FeatureCollectionRole role)
          Check if this FeatureCollection has a role like the given one
 FeatureCollectionRole getRole(FeatureCollectionRoleTypes role)
          Check if this FeatureCollection has a role like the given one
 FeatureCollectionRole getRole(int roleId)
          Check if this FeatureCollection has a role with the given ID
 FeatureCollectionRole[] getRoles()
           
 FeatureCollection getWrappee()
          the PirolFeatureCollection is a wrapper for other feature collections in some cases one might want to work with the original FC.
 java.util.Collection getXmlRoles()
          for java2xml
 int hashCode()
           
 void invalidateEnvelope(boolean simpleInvalidation)
           
 boolean isEmpty()
          Returns whether this collection has no features.
 java.util.Iterator iterator()
          Returns an Iterator over the features
 java.util.List query(com.vividsolutions.jts.geom.Envelope envelope)
          A quick search for features, using an envelope comparison.
 java.util.Collection remove(com.vividsolutions.jts.geom.Envelope env)
          Removes the features which intersect the given envelope
 void remove(Feature feature)
          Removes a feature from this collection.
 void removeAll(java.util.Collection features)
          Removes multiple features from this collection.
 void removeRole(FeatureCollectionRole role)
           
 void setFeatureDataSet(FeatureCollection featureDataSet)
          for java2xml
 void setMetaInformation(MetaDataMap metaInformation)
           
 int size()
          Returns the number of features in this collection.
 Feature[] toArray()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

featureDataSet

protected FeatureCollection featureDataSet

metaInformation

protected MetaDataMap metaInformation

roles

protected FeatureCollectionRole[] roles
Constructor Detail

PirolFeatureCollection

public PirolFeatureCollection(FeatureCollection featureDataSet,
                              FeatureCollectionRole initRole)

PirolFeatureCollection

public PirolFeatureCollection()
Constructor - for java2xml, only!!

Method Detail

getXmlRoles

public java.util.Collection getXmlRoles()
for java2xml


addXmlRole

public void addXmlRole(FeatureCollectionRole role)
for java2xml


getFeatureDataSet

public FeatureCollection getFeatureDataSet()
for java2xml


setFeatureDataSet

public void setFeatureDataSet(FeatureCollection featureDataSet)
for java2xml


addRole

public void addRole(FeatureCollectionRole role)

removeRole

public void removeRole(FeatureCollectionRole role)

getRoles

public FeatureCollectionRole[] getRoles()

getRole

public FeatureCollectionRole getRole(FeatureCollectionRole role)
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:
PirolFeatureCollectionRoleTypes

getRole

public FeatureCollectionRole getRole(FeatureCollectionRoleTypes role)
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:
PirolFeatureCollectionRoleTypes

getRole

public FeatureCollectionRole getRole(int roleId)
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:
PirolFeatureCollectionRoleTypes

getMetaInformation

public MetaDataMap getMetaInformation()
Specified by:
getMetaInformation in interface ObjectContainingMetaInformation

setMetaInformation

public void setMetaInformation(MetaDataMap metaInformation)
Specified by:
setMetaInformation in interface ObjectContainingMetaInformation

invalidateEnvelope

public void invalidateEnvelope(boolean simpleInvalidation)

add

public void add(Feature feature)
Description copied from interface: FeatureCollection
Adds a feature to this collection.

Specified by:
add in interface FeatureCollection
Parameters:
feature - a Feature to add to the end of this collection

addAll

public void addAll(java.util.Collection features)
Description copied from interface: FeatureCollection
Adds 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:
addAll in interface FeatureCollection

clear

public void clear()
Description copied from interface: FeatureCollection
Removes all features from this collection.

Specified by:
clear in interface FeatureCollection

equals

public boolean equals(java.lang.Object arg0)
Overrides:
equals in class java.lang.Object

getEnvelope

public com.vividsolutions.jts.geom.Envelope getEnvelope()
Description copied from interface: FeatureCollection
Returns the bounds of this collection.

Specified by:
getEnvelope in interface FeatureCollection
Returns:
the smallest Envelope enclosing all the Features in this collection

getFeatures

public java.util.List getFeatures()
Description copied from interface: FeatureCollection
Returns an unmodifiable List of the features in this collection

Specified by:
getFeatures in interface FeatureCollection
Returns:
a read-only view of all the features

getFeatureSchema

public FeatureSchema getFeatureSchema()
Description copied from interface: FeatureCollection
Returns information about this FeatureCollection

Specified by:
getFeatureSchema in interface FeatureCollection
Returns:
the types of the attributes of the features in this collection

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

isEmpty

public boolean isEmpty()
Description copied from interface: FeatureCollection
Returns whether this collection has no features.

Specified by:
isEmpty in interface FeatureCollection
Returns:
whether or not the size of this collection is 0

iterator

public java.util.Iterator iterator()
Description copied from interface: FeatureCollection
Returns an Iterator over the features

Specified by:
iterator in interface FeatureCollection
Returns:
an Iterator over the features

query

public java.util.List query(com.vividsolutions.jts.geom.Envelope envelope)
Description copied from interface: FeatureCollection
A quick search for features, using an envelope comparison.

Specified by:
query in interface FeatureCollection
Parameters:
envelope - the envelope to query against
Returns:
features whose envelopes intersect the given envelope

remove

public java.util.Collection remove(com.vividsolutions.jts.geom.Envelope env)
Description copied from interface: FeatureCollection
Removes the features which intersect the given envelope

Specified by:
remove in interface FeatureCollection
Returns:
the removed features

remove

public void remove(Feature feature)
Description copied from interface: FeatureCollection
Removes a feature from this collection.

Specified by:
remove in interface FeatureCollection
Parameters:
feature - a Feature to remove from this collection

removeAll

public void removeAll(java.util.Collection features)
Description copied from interface: FeatureCollection
Removes 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:
removeAll in interface FeatureCollection

size

public int size()
Description copied from interface: FeatureCollection
Returns the number of features in this collection.

Specified by:
size in interface FeatureCollection
Returns:
the number of features in this collection

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toArray

public Feature[] toArray()

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

getWrappee

public FeatureCollection 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