ucar.nc2.ft.point
Class MultipleNestedPointCollectionImpl

java.lang.Object
  extended by ucar.nc2.ft.point.MultipleNestedPointCollectionImpl
All Implemented Interfaces:
FeatureCollection, NestedPointFeatureCollection
Direct Known Subclasses:
SectionCollectionImpl, StationProfileCollectionImpl

public abstract class MultipleNestedPointCollectionImpl
extends Object
implements NestedPointFeatureCollection

Abstract superclass for multiply nested NestedPointFeatureCollection Subclass must supply getNestedPointFeatureCollectionIterator().

Since:
Mar 26, 2008
Author:
caron

Field Summary
protected  String name
           
 
Constructor Summary
protected MultipleNestedPointCollectionImpl(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.
 PointFeatureCollectionIterator getPointFeatureCollectionIterator(int bufferSize)
          Iterate through the collection, composed of PointFeatureCollection.
 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
getNestedPointFeatureCollectionIterator, subset
 

Field Detail

name

protected String name
Constructor Detail

MultipleNestedPointCollectionImpl

protected MultipleNestedPointCollectionImpl(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

getPointFeatureCollectionIterator

public PointFeatureCollectionIterator getPointFeatureCollectionIterator(int bufferSize)
                                                                 throws IOException
Description copied from interface: NestedPointFeatureCollection
Iterate through the collection, composed of PointFeatureCollection. Use this only if isMultipleNested() = false.

Specified by:
getPointFeatureCollectionIterator in interface NestedPointFeatureCollection
Parameters:
bufferSize - how many bytes can be used to buffer data, use -1 to use default.
Returns:
an iterator through PointFeatureCollection 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.