|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectDecoratingFeatureCollection<SimpleFeatureType,SimpleFeature>
ReprojectingFeatureCollection
public class ReprojectingFeatureCollection
FeatureCollection
The implementation of Collection must adhere to the rules of
fail-fast concurrent modification. In addition (to allow for
resource backed collections, the
This is almost equivalent to:
Field Summary
Fields inherited from class DecoratingFeatureCollection
delegate
Constructor Summary
ReprojectingFeatureCollection(FeatureCollection<SimpleFeatureType,SimpleFeature> delegate,
CoordinateReferenceSystem target)
ReprojectingFeatureCollection(FeatureCollection<SimpleFeatureType,SimpleFeature> delegate,
CoordinateReferenceSystem source,
CoordinateReferenceSystem target)
Method Summary
boolean
add(SimpleFeature o)
Add object to this collection.
void
close(FeatureIterator<SimpleFeature> close)
Clean up after any resources associated with this FeatureIterator in a manner similar to JDO collections.
void
close(Iterator close)
Clean up after any resources associated with this itterator in a manner similar to JDO collections.
FeatureIterator<SimpleFeature>
features()
Obtain a FeatureIterator
ReferencedEnvelope
getBounds()
This method computes reprojected bounds the hard way, but computing them
feature by feature.
SimpleFeatureType
getSchema()
The schema for the child features of this collection.
Iterator<SimpleFeature>
iterator()
An iterator over this collection, which must be closed after use.
FeatureReader<SimpleFeatureType,SimpleFeature>
reader()
void
setTransformer(GeometryCoordinateSequenceTransformer transformer)
FeatureCollection<SimpleFeatureType,SimpleFeature>
sort(SortBy order)
collection.subCollection( myFilter ).sort( {"foo","bar"} );
collection.subCollection( myFilter ).sort( "bar" ).sort("foo")
FeatureCollection<SimpleFeatureType,SimpleFeature>
subCollection(Filter filter)
FeatureCollection
Object[]
toArray()
Object[]
toArray(Object[] a)
Methods inherited from class DecoratingFeatureCollection
accepts, accepts, addAll, addAll, addListener, clear, contains, containsAll, equals, getID, hashCode, isEmpty, purge, remove, removeAll, removeListener, retainAll, size
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Constructor Detail
ReprojectingFeatureCollection
public ReprojectingFeatureCollection(FeatureCollection<SimpleFeatureType,SimpleFeature> delegate,
CoordinateReferenceSystem target)
ReprojectingFeatureCollection
public ReprojectingFeatureCollection(FeatureCollection<SimpleFeatureType,SimpleFeature> delegate,
CoordinateReferenceSystem source,
CoordinateReferenceSystem target)
Method Detail
setTransformer
public void setTransformer(GeometryCoordinateSequenceTransformer transformer)
reader
public FeatureReader<SimpleFeatureType,SimpleFeature> reader()
throws IOException
IOException
features
public FeatureIterator<SimpleFeature> features()
FeatureCollection
close( Iterator )
method must be called.
getAttribute(getFeatureType().getAttributeType(0).getName()).iterator();
.
Iterator<Feature>
FeatureIterator iterator=collection.features();
try {
while( iterator.hasNext() ){
Feature feature = iterator.next();
System.out.println( feature.getID() );
}
}
finally {
collection.close( iterator );
}
GML Note: The contents of this iterator are considered to be defined by featureMember tags (and/or the single allowed FeatureMembers tag). Please see getFeatureType for more details.
features
in interface FeatureCollection<SimpleFeatureType,SimpleFeature>
features
in class DecoratingFeatureCollection<SimpleFeatureType,SimpleFeature>
public void close(FeatureIterator<SimpleFeature> close)
FeatureCollection
Iterator iterator = collection.iterator();
try {
for( Iterator i=collection.iterator(); i.hasNext();){
Feature feature = i.hasNext();
System.out.println( feature.getID() );
}
}
finally {
collection.close( iterator );
}
close
in interface FeatureCollection<SimpleFeatureType,SimpleFeature>
close
in class DecoratingFeatureCollection<SimpleFeatureType,SimpleFeature>
public Iterator<SimpleFeature> iterator()
FeatureCollection
Collection is not guaranteed to be ordered in any manner.
The implementation of Collection must adhere to the rules of
fail-fast concurrent modification. In addition (to allow for
resource backed collections, the close( Iterator )
method must be called.
Example (safe) use:
Iterator iterator = collection.iterator();
try {
while( iterator.hasNext();){
Feature feature = (Feature) iterator.hasNext();
System.out.println( feature.getID() );
}
}
finally {
collection.close( iterator );
}
iterator
in interface FeatureCollection<SimpleFeatureType,SimpleFeature>
iterator
in class DecoratingFeatureCollection<SimpleFeatureType,SimpleFeature>
public void close(Iterator close)
FeatureCollection
Iterator iterator = collection.iterator();
try {
for( Iterator i=collection.iterator(); i.hasNext();){
Feature feature = (Feature) i.hasNext();
System.out.println( feature.getID() );
}
}
finally {
collection.close( iterator );
}
close
in interface FeatureCollection<SimpleFeatureType,SimpleFeature>
close
in class DecoratingFeatureCollection<SimpleFeatureType,SimpleFeature>
public SimpleFeatureType getSchema()
FeatureCollection
There is a difference between getFeatureType() and getSchema()represents the LCD FeatureType that best represents the contents of this collection.
The method getSchema() is named for compatability with the geotools 2.0 API. In the Geotools 2.2 time frame we should be able to replace this method with a careful check of getFeatureType() and its attributes.
getSchema
in interface FeatureCollection<SimpleFeatureType,SimpleFeature>
getSchema
in class DecoratingFeatureCollection<SimpleFeatureType,SimpleFeature>
public FeatureCollection<SimpleFeatureType,SimpleFeature> subCollection(Filter filter)
FeatureCollection
The contents of the returned FeatureCollection
This method is used cut down on the number of filter based methods
required for a useful FeatureCollection
Example Use:
The results of subCollection:
The above recommended use is agreement with the Collections API precident of
List.subList( start, end ).
collection.subCollection( filter ).clear();
subCollection
in interface FeatureCollection<SimpleFeatureType,SimpleFeature>
subCollection
in class DecoratingFeatureCollection<SimpleFeatureType,SimpleFeature>
FeatureList
public FeatureCollection<SimpleFeatureType,SimpleFeature> sort(SortBy order)
FeatureCollection
sort
in interface FeatureCollection<SimpleFeatureType,SimpleFeature>
sort
in class DecoratingFeatureCollection<SimpleFeatureType,SimpleFeature>
public Object[] toArray()
toArray
in interface FeatureCollection<SimpleFeatureType,SimpleFeature>
toArray
in class DecoratingFeatureCollection<SimpleFeatureType,SimpleFeature>
Collection.toArray()
public Object[] toArray(Object[] a)
toArray
in interface FeatureCollection<SimpleFeatureType,SimpleFeature>
toArray
in class DecoratingFeatureCollection<SimpleFeatureType,SimpleFeature>
Collection.toArray(Object[])
public boolean add(SimpleFeature o)
FeatureCollection
This method is often not impelmented for collections produced as the result of a query.
add
in interface FeatureCollection<SimpleFeatureType,SimpleFeature>
add
in class DecoratingFeatureCollection<SimpleFeatureType,SimpleFeature>
Collection.add(Object)
public ReferencedEnvelope getBounds()
getBounds
in interface FeatureCollection<SimpleFeatureType,SimpleFeature>
getBounds
in class DecoratingFeatureCollection<SimpleFeatureType,SimpleFeature>
org.geotools.data.FeatureResults#getBounds()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |