ucar.nc2.ft.point
Class PointCollectionImpl

java.lang.Object
  extended by ucar.nc2.ft.point.PointCollectionImpl
All Implemented Interfaces:
FeatureCollection, PointFeatureCollection
Direct Known Subclasses:
ProfileFeatureImpl, StandardPointCollectionImpl, StationFeatureImpl, TrajectoryFeatureImpl

public abstract class PointCollectionImpl
extends java.lang.Object
implements PointFeatureCollection

Abstract superclass for PointFeatureCollection Subclass must supply getPointFeatureIterator().

Since:
Mar 1, 2008
Author:
caron

Field Summary
protected  LatLonRect boundingBox
           
protected  DateRange dateRange
           
protected  PointFeatureIterator localIterator
           
protected  java.lang.String name
           
protected  int npts
           
 
Constructor Summary
protected PointCollectionImpl(java.lang.String name)
           
protected PointCollectionImpl(java.lang.String name, LatLonRect boundingBox, DateRange dateRange, int npts)
           
 
Method Summary
 FeatureType getCollectionFeatureType()
          All features in this collection have this feature type
 java.lang.String getName()
          Get the name of this feature 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.
protected  void setSize(int npts)
           
 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ucar.nc2.ft.PointFeatureCollection
getPointFeatureIterator
 

Field Detail

name

protected java.lang.String name

boundingBox

protected LatLonRect boundingBox

dateRange

protected DateRange dateRange

npts

protected int npts

localIterator

protected PointFeatureIterator localIterator
Constructor Detail

PointCollectionImpl

protected PointCollectionImpl(java.lang.String name)

PointCollectionImpl

protected PointCollectionImpl(java.lang.String name,
                              LatLonRect boundingBox,
                              DateRange dateRange,
                              int npts)
Method Detail

getName

public java.lang.String getName()
Description copied from interface: FeatureCollection
Get the name of this feature collection.

Specified by:
getName in interface FeatureCollection
Returns:
the name of this feature collection

hasNext

public boolean hasNext()
                throws java.io.IOException
Description copied from interface: PointFeatureCollection
Use the internal iterator to check if there is another PointFeature in the iteration.

Specified by:
hasNext in interface PointFeatureCollection
Returns:
true is there is another PointFeature in the iteration.
Throws:
java.io.IOException - on read error

next

public PointFeature next()
                  throws java.io.IOException
Description copied from interface: PointFeatureCollection
Use the internal iterator to get the next PointFeature in the iteration. You must call hasNext() before you call this.

Specified by:
next in interface PointFeatureCollection
Returns:
the next PointFeature in the iteration
Throws:
java.io.IOException - on read error

resetIteration

public void resetIteration()
                    throws java.io.IOException
Description copied from interface: PointFeatureCollection
Reset the internal iterator for another iteration over the PointFeatures in this Collection.

Specified by:
resetIteration in interface PointFeatureCollection
Throws:
java.io.IOException - on read error

size

public int size()
Description copied from interface: PointFeatureCollection
The number of points in the collection. May not be known until after iterating through the collection.

Specified by:
size in interface PointFeatureCollection
Returns:
number of points in the collection, or -1 if not known.

setSize

protected void setSize(int npts)

getCollectionFeatureType

public FeatureType getCollectionFeatureType()
Description copied from interface: FeatureCollection
All features in this collection have this feature type

Specified by:
getCollectionFeatureType in interface FeatureCollection
Returns:
the feature type

subset

public PointFeatureCollection subset(LatLonRect boundingBox,
                                     DateRange dateRange)
                              throws java.io.IOException
Description copied from interface: PointFeatureCollection
Subset this collection by boundingBox and/or dateRange

Specified by:
subset in interface PointFeatureCollection
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