org.geotools.feature.collection
Class SubResourceList

java.lang.Object
  extended byorg.geotools.feature.collection.AbstractResourceCollection
      extended byorg.geotools.feature.collection.AbstractResourceList
          extended byorg.geotools.feature.collection.SubResourceList
All Implemented Interfaces:
java.util.Collection, java.util.List, ResourceCollection, ResourceList

public class SubResourceList
extends AbstractResourceList
implements ResourceCollection, java.util.List

Simple SubList based on from, to index.


Field Summary
 
Fields inherited from class org.geotools.feature.collection.AbstractResourceList
modCount
 
Fields inherited from class org.geotools.feature.collection.AbstractResourceCollection
open
 
Constructor Summary
SubResourceList(ResourceList collection, int from, int to)
           
 
Method Summary
 void clear()
          Removes all of the elements from this collection (optional operation).
protected  void closeIterator(java.util.Iterator close)
          Please override to cleanup after your own iterators, and any used resources.
 java.lang.Object get(int index)
          item at the specified index.
protected  java.util.Iterator openIterator()
          Returns a quick iterator that uses get and size methods.
 java.util.ListIterator openIterator(int index)
           
 int size()
          Returns the number of elements in this collection.
 
Methods inherited from class org.geotools.feature.collection.AbstractResourceList
add, add, addAll, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
 
Methods inherited from class org.geotools.feature.collection.AbstractResourceCollection
addAll, close, contains, containsAll, isEmpty, iterator, purge, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.geotools.data.collection.ResourceCollection
close, iterator, purge
 
Methods inherited from interface java.util.Collection
add, addAll, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, toArray, toArray
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, subList, toArray, toArray
 

Constructor Detail

SubResourceList

public SubResourceList(ResourceList collection,
                       int from,
                       int to)
Method Detail

get

public java.lang.Object get(int index)
Description copied from class: AbstractResourceList
item at the specified index.

Specified by:
get in interface java.util.List
Specified by:
get in class AbstractResourceList
Parameters:
index - index of item
Returns:
the item at the specified index.

size

public int size()
Description copied from class: AbstractResourceCollection
Returns the number of elements in this collection.

Specified by:
size in interface java.util.Collection
Specified by:
size in class AbstractResourceCollection
Returns:
Number of items, or Interger.MAX_VALUE

openIterator

protected java.util.Iterator openIterator()
Description copied from class: AbstractResourceList
Returns a quick iterator that uses get and size methods.

As with all resource collections it is assumed that the iterator will be closed after use.

Overrides:
openIterator in class AbstractResourceList
Returns:
an iterator over the elements in this list in proper sequence.
See Also:
AbstractResourceList.modCount

openIterator

public java.util.ListIterator openIterator(int index)
Overrides:
openIterator in class AbstractResourceList

closeIterator

protected void closeIterator(java.util.Iterator close)
Description copied from class: AbstractResourceCollection
Please override to cleanup after your own iterators, and any used resources.

As an example if the iterator was working off a File then the inputstream should be closed.

Subclass must call super.close( close ) to allow the list of open iterators to be adjusted.

Overrides:
closeIterator in class AbstractResourceList

clear

public void clear()
Description copied from class: AbstractResourceList
Removes all of the elements from this collection (optional operation).

This implementation calls removeRange(0, size()).

Note that this implementation throws an UnsupportedOperationException unless remove(int index) or removeRange(int fromIndex, int toIndex) is overridden.

Specified by:
clear in interface java.util.Collection
Overrides:
clear in class AbstractResourceList


Copyright © GeoTools. All Rights Reserved.