|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectDecoratingFeatureCollection<SimpleFeatureType,SimpleFeature>
ReTypingFeatureCollection
public class ReTypingFeatureCollection
FeatureCollection
There is a difference between getFeatureType() and getSchema()represents the LCD
FeatureType that best represents the contents of this collection.
modules/library/main (gt-main.jar)
Field Summary
Fields inherited from class DecoratingFeatureCollection
delegate
Constructor Summary
ReTypingFeatureCollection(FeatureCollection<SimpleFeatureType,SimpleFeature> delegate,
SimpleFeatureType featureType)
Method Summary
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
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()
Methods inherited from class DecoratingFeatureCollection
accepts, accepts, add, addAll, addAll, addListener, clear, contains, containsAll, equals, getBounds, getID, hashCode, isEmpty, purge, remove, removeAll, removeListener, retainAll, size, sort, subCollection, toArray, toArray
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Constructor Detail
ReTypingFeatureCollection
public ReTypingFeatureCollection(FeatureCollection<SimpleFeatureType,SimpleFeature> delegate,
SimpleFeatureType featureType)
Method Detail
getSchema
public SimpleFeatureType getSchema()
FeatureCollection
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 FeatureReader<SimpleFeatureType,SimpleFeature> reader() throws IOException
IOException
public FeatureIterator<SimpleFeature> features()
FeatureCollection
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.
This is almost equivalent to:
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>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |