ucar.nc2.ft.point
Class OneNestedPointCollectionImpl

java.lang.Object
  extended by ucar.nc2.ft.point.OneNestedPointCollectionImpl
All Implemented Interfaces:
FeatureCollection, NestedPointFeatureCollection
Direct Known Subclasses:
SectionFeatureImpl, StandardProfileCollectionImpl, StandardTrajectoryCollectionImpl, StationProfileFeatureImpl, StationTimeSeriesCollectionImpl

public abstract class OneNestedPointCollectionImpl
extends Object
implements NestedPointFeatureCollection

Abstract superclass for singly nested NestedPointFeatureCollection Subclass must supply getPointFeatureCollectionIterator()

Since:
Mar 20, 2008
Author:
caron

Field Summary
protected  int npts
           
 
Constructor Summary
protected OneNestedPointCollectionImpl(String name, FeatureType collectionFeatureType)
           
 
Method Summary
 PointFeatureCollection flatten(LatLonRect boundingBox, DateRange dateRange)
          Flatten into a PointFeatureCollection, discarding connectedness information.
 FeatureType getCollectionFeatureType()
          All features in this collection have this feature type
 String getName()
          Get the name of this feature collection.
 NestedPointFeatureCollectionIterator getNestedPointFeatureCollectionIterator(int bufferSize)
          Iterate through the collection, composed of NestedPointFeatureCollection.
 boolean isMultipleNested()
          If true, use getNestedPointFeatureCollectionIterator, otherwise use getPointFeatureCollectionIterator.
protected  void setSize(int npts)
           
 int size()
          The number of elements in the collection.
 
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.NestedPointFeatureCollection
getPointFeatureCollectionIterator, subset
 

Field Detail

npts

protected int npts
Constructor Detail

OneNestedPointCollectionImpl

protected OneNestedPointCollectionImpl(String name,
                                       FeatureType collectionFeatureType)
Method Detail

getName

public 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

size

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

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

setSize

protected void setSize(int npts)

isMultipleNested

public boolean isMultipleNested()
Description copied from interface: NestedPointFeatureCollection
If true, use getNestedPointFeatureCollectionIterator, otherwise use getPointFeatureCollectionIterator.

Specified by:
isMultipleNested in interface NestedPointFeatureCollection
Returns:
if multiple nested

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

getNestedPointFeatureCollectionIterator

public NestedPointFeatureCollectionIterator getNestedPointFeatureCollectionIterator(int bufferSize)
                                                                             throws IOException
Description copied from interface: NestedPointFeatureCollection
Iterate through the collection, composed of NestedPointFeatureCollection. Use this only if isMultipleNested() = true.

Specified by:
getNestedPointFeatureCollectionIterator in interface NestedPointFeatureCollection
Parameters:
bufferSize - how many bytes can be used to buffer data, use -1 to use default.
Returns:
an iterator through NestedPointFeatureCollection objects.
Throws:
IOException - on read error

flatten

public PointFeatureCollection flatten(LatLonRect boundingBox,
                                      DateRange dateRange)
                               throws IOException
Description copied from interface: NestedPointFeatureCollection
Flatten into a PointFeatureCollection, discarding connectedness information. Optionally subset.

Specified by:
flatten in interface NestedPointFeatureCollection
Parameters:
boundingBox - only points in this lat/lon bounding box. may be null.
dateRange - only points in this date range. may be null.
Returns:
a PointFeatureCollection, may be null if its empty.
Throws:
IOException - on read error


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