ucar.nc2.ft.point
Class PointIteratorImpl

java.lang.Object
  extended by ucar.nc2.ft.point.PointIteratorImpl
All Implemented Interfaces:
PointFeatureIterator
Direct Known Subclasses:
StandardPointFeatureIterator

public abstract class PointIteratorImpl
extends java.lang.Object
implements PointFeatureIterator

Use StructureDataIterator to iterate over members of a Structure, with optional filtering. Subclass must implement makeFeature().

Since:
Feb 29, 2008
Author:
caron

Nested Class Summary
 
Nested classes/interfaces inherited from interface ucar.nc2.ft.PointFeatureIterator
PointFeatureIterator.Filter
 
Field Summary
protected  boolean calcBB
           
 
Constructor Summary
protected PointIteratorImpl(PointFeatureIterator.Filter filter, boolean calcBB)
           
protected PointIteratorImpl(StructureDataIterator structIter, PointFeatureIterator.Filter filter, boolean calcBB)
           
 
Method Summary
 LatLonRect getBoundingBox()
          Get BoundingBox after iteration is finished, if calcBB was set true
 int getCount()
          Get number of points returned so far
 DateRange getDateRange(DateUnit timeUnit)
          Get DateRange of observation time after iteration is finished, if calcBB was set true
 boolean hasNext()
          Check if another PointFeature is available
protected abstract  PointFeature makeFeature(int recnum, StructureData sdata)
           
 PointFeature next()
          Returns the next PointFeature.
protected  StructureData nextStructureData()
           
 void setBufferSize(int bytes)
          Hint to use this much memory in buffering the iteration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

calcBB

protected boolean calcBB
Constructor Detail

PointIteratorImpl

protected PointIteratorImpl(PointFeatureIterator.Filter filter,
                            boolean calcBB)
                     throws java.io.IOException
Throws:
java.io.IOException

PointIteratorImpl

protected PointIteratorImpl(StructureDataIterator structIter,
                            PointFeatureIterator.Filter filter,
                            boolean calcBB)
                     throws java.io.IOException
Throws:
java.io.IOException
Method Detail

makeFeature

protected abstract PointFeature makeFeature(int recnum,
                                            StructureData sdata)
                                     throws java.io.IOException
Throws:
java.io.IOException

hasNext

public boolean hasNext()
                throws java.io.IOException
Description copied from interface: PointFeatureIterator
Check if another PointFeature is available

Specified by:
hasNext in interface PointFeatureIterator
Returns:
true if another PointFeature is available
Throws:
java.io.IOException - on i/o error

next

public PointFeature next()
                  throws java.io.IOException
Description copied from interface: PointFeatureIterator
Returns the next PointFeature. You must call hasNext() before calling next(), even if you know it will return true.

Specified by:
next in interface PointFeatureIterator
Returns:
the next PointFeature
Throws:
java.io.IOException - on i/o error

setBufferSize

public void setBufferSize(int bytes)
Description copied from interface: PointFeatureIterator
Hint to use this much memory in buffering the iteration. No guarentee that it will be used by the implementation.

Specified by:
setBufferSize in interface PointFeatureIterator
Parameters:
bytes - amount of memory in bytes

nextStructureData

protected StructureData nextStructureData()
                                   throws java.io.IOException
Throws:
java.io.IOException

getBoundingBox

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

Returns:
BoundingBox of all returned points

getDateRange

public DateRange getDateRange(DateUnit timeUnit)
Get DateRange of observation time after iteration is finished, if calcBB was set true

Parameters:
timeUnit - to convert times to dates
Returns:
DateRange of all returned points

getCount

public int getCount()
Get number of points returned so far

Returns:
number of points returned so far