ucar.nc2.ft
Interface PointFeatureIterator

All Known Implementing Classes:
PointIteratorAbstract, PointIteratorEmpty, PointIteratorFiltered, PointIteratorFlatten, PointIteratorFromStructureData, PointIteratorMultidim, RemotePointFeatureIterator, StandardPointFeatureIterator

public interface PointFeatureIterator

An iterator over PointFeatures. You must complete the iteration or call finish(). Best to put in a try/finally block like:

  try {
   while (iter.hasNext())
     process(iter.next());
  } finally {
    iter.finish();
  }
  

Since:
Feb 18, 2008
Author:
caron

Nested Class Summary
static interface PointFeatureIterator.Filter
          A filter on PointFeatures
 
Method Summary
 void finish()
          Make sure that the iterator is complete, and recover resources.
 LatLonRect getBoundingBox()
          Get BoundingBox after iteration is finished, if calcBounds was set true
 int getCount()
          Get number of points after the iteration is finished, if calcBounds was set true
 DateRange getDateRange()
          Get DateRange of observation time after iteration is finished, if calcBounds was set true
 boolean hasNext()
          Check if another PointFeature is available
 PointFeature next()
          Returns the next PointFeature.
 void setBufferSize(int bytes)
          Hint to use this much memory in buffering the iteration.
 void setCalculateBounds(PointFeatureCollection collection)
          If this is set, then the iterator will calculate the bounding box, time range, and size, and make it available through getBoundingBox(), getDateRange(), and getSize().
 

Method Detail

hasNext

boolean hasNext()
                throws IOException
Check if another PointFeature is available

Returns:
true if another PointFeature is available
Throws:
IOException - on i/o error

next

PointFeature next()
                  throws IOException
Returns the next PointFeature. You must call hasNext() before calling next(), even if you know it will return true.

Returns:
the next PointFeature
Throws:
IOException - on i/o error

finish

void finish()
Make sure that the iterator is complete, and recover resources. You must complete the iteration (until hasNext() returns false) or call finish(). may be called more than once.


setBufferSize

void setBufferSize(int bytes)
Hint to use this much memory in buffering the iteration. No guarentee that it will be used by the implementation.

Parameters:
bytes - amount of memory in bytes

setCalculateBounds

void setCalculateBounds(PointFeatureCollection collection)
If this is set, then the iterator will calculate the bounding box, time range, and size, and make it available through getBoundingBox(), getDateRange(), and getSize().

Parameters:
collection - if not null, on complete iteration set the results into the collection.

getBoundingBox

LatLonRect getBoundingBox()
Get BoundingBox after iteration is finished, if calcBounds was set true

Returns:
BoundingBox of all returned points

getDateRange

DateRange getDateRange()
Get DateRange of observation time after iteration is finished, if calcBounds was set true

Returns:
DateRange of all returned points

getCount

int getCount()
Get number of points after the iteration is finished, if calcBounds was set true

Returns:
number of points in the iteration


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.