ucar.nc2.ft
Interface PointFeatureCollection

All Superinterfaces:
FeatureCollection
All Known Subinterfaces:
ProfileFeature, StationTimeSeriesFeature, TrajectoryFeature

public interface PointFeatureCollection
extends FeatureCollection

A collection of PointFeatures.

Since:
Mar 1, 2008
Author:
caron

Method Summary
 void calcBounds()
          Caclulate date range and bounding box, and size, even if the data has to be scanned.
 void finish()
          Make sure that the internal iterator is complete, and recover resources.
 LatLonRect getBoundingBox()
          The boundingBox for the FeatureCollection.
 DateRange getDateRange()
          Date range for the FeatureCollection.
 PointFeatureIterator getPointFeatureIterator(int bufferSize)
          Get an iterator over the PointFeatures of this collection
 boolean hasNext()
          Use the internal iterator to check if there is another PointFeature in the iteration.
 PointFeature next()
          Use the internal iterator to get the next PointFeature in the iteration.
 void resetIteration()
          Reset the internal iterator for another iteration over the PointFeatures in this Collection.
 void setBoundingBox(LatLonRect bb)
          Set the boundingBox for the FeatureCollection.
 void setDateRange(DateRange range)
          Set the date range for the FeatureCollection.
 void setSize(int npts)
          Set the size of the FeatureCollection.
 int size()
          The number of points in the collection.
 PointFeatureCollection subset(LatLonRect boundingBox, DateRange dateRange)
          Subset this collection by boundingBox and/or dateRange
 
Methods inherited from interface ucar.nc2.ft.FeatureCollection
getCollectionFeatureType, getName
 

Method Detail

hasNext

boolean hasNext()
                throws java.io.IOException
Use the internal iterator to check if there is another PointFeature in the iteration.

Returns:
true is there is another PointFeature in the iteration.
Throws:
java.io.IOException - on read error
See Also:
PointFeatureIterator.hasNext()

next

PointFeature next()
                  throws java.io.IOException
Use the internal iterator to get the next PointFeature in the iteration. You must call hasNext() before you call this.

Returns:
the next PointFeature in the iteration
Throws:
java.io.IOException - on read error
See Also:
PointFeatureIterator.next()

resetIteration

void resetIteration()
                    throws java.io.IOException
Reset the internal iterator for another iteration over the PointFeatures in this Collection.

Throws:
java.io.IOException - on read error

finish

void finish()
Make sure that the internal iterator is complete, and recover resources. You must complete the iteration (until hasNext() returns false) or call finish().

See Also:
PointFeatureIterator.finish()

size

int size()
The number of points in the collection. May not be known until after iterating through the collection.

Returns:
number of points in the collection, or -1 if not known.

getDateRange

DateRange getDateRange()
Date range for the FeatureCollection. May not be known until after iterating through the collection.

Returns:
the date range for the entire collection, or null if unknown

getBoundingBox

LatLonRect getBoundingBox()
The boundingBox for the FeatureCollection. May not be known until after iterating through the collection.

Returns:
the lat/lon boundingBox for the entire collection, or null if unknown.

setDateRange

void setDateRange(DateRange range)
Set the date range for the FeatureCollection.

Parameters:
range - the date range for the entire collection

setBoundingBox

void setBoundingBox(LatLonRect bb)
Set the boundingBox for the FeatureCollection.

Parameters:
bb - the lat/lon boundingBox for the entire collection.

setSize

void setSize(int npts)
Set the size of the FeatureCollection.

Parameters:
npts - size of the collection

calcBounds

void calcBounds()
                throws java.io.IOException
Caclulate date range and bounding box, and size, even if the data has to be scanned. This ensures that getDateRange() and getBoundingBox() return non-null. If the collection already knows its size, date range and bounding box, then this has no effect.

Throws:
java.io.IOException - or read error.

getPointFeatureIterator

PointFeatureIterator getPointFeatureIterator(int bufferSize)
                                             throws java.io.IOException
Get an iterator over the PointFeatures of this collection

Parameters:
bufferSize - how many bytes can be used to buffer data, use -1 to use default.
Returns:
iterator over the PointFeatures of this collection
Throws:
java.io.IOException - on read error

subset

PointFeatureCollection subset(LatLonRect boundingBox,
                              DateRange dateRange)
                              throws java.io.IOException
Subset this collection by boundingBox and/or dateRange

Parameters:
boundingBox - only points in this lat/lon bounding box. may be null.
dateRange - only points in this date range. may be null.
Returns:
subsetted collection, may be null if empty
Throws:
java.io.IOException - on read error