org.jaitools.media.jai.zonalstats
Class Result

java.lang.Object
  extended by org.jaitools.media.jai.zonalstats.Result

public class Result
extends Object

Holds the result for a a given combination of image band / zone / statistic. See documentation for ZonalStats for examples of how to access results.

Author:
Michael Bedward
See Also:
ZonalStats

Constructor Summary
Result(int imageBand, int zone, Statistic stat, List<Range> ranges, Double value, long numOffered, long numAccepted, long numNaN, long numNoData)
          Create a new Result object.
 
Method Summary
 int getImageBand()
          Get the index of the image band for which this result was calculated.
 long getNumAccepted()
          Get the number of values that were accepted, ie.
 long getNumNaN()
          Get the number of NaN values that were sampled from the image when calculating this result.
 long getNumNoData()
          Get the number of NoData values that were sampled from the image when calculating this result.
 long getNumOffered()
          Get the number of values that were offered, ie.
 Collection<Range> getRanges()
          Get the ranges (if defined) that were used to filter data image values for inclusion in the calculation of this result.
 Statistic getStatistic()
          Get the statistic that this result pertains to.
 Double getValue()
          Get the calculated value of the statistic.
 int getZone()
          Get the integer ID of the image zone for which this result was calculated.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Result

public Result(int imageBand,
              int zone,
              Statistic stat,
              List<Range> ranges,
              Double value,
              long numOffered,
              long numAccepted,
              long numNaN,
              long numNoData)
Create a new Result object. This is intended for use by the ZonalStats class rather than client code.

Parameters:
imageBand - data image band
zone - integer identifier of the zone in the zone image; 0 should be passed when no zone image was used
stat - the statistic to which this result pertains
ranges - list of ranges (if any) used to filter data image values
value - the calculated value of the statistic
numOffered - number of data image values considered for inclusion
numAccepted - number of data image values actually used for calculating this result
numNaN - number of NaN values read from the data image
numNoData - number of NoData values read from the data image
Method Detail

getRanges

public Collection<Range> getRanges()
Get the ranges (if defined) that were used to filter data image values for inclusion in the calculation of this result.

Returns:
ranges used to filter data image values

getImageBand

public int getImageBand()
Get the index of the image band for which this result was calculated.

Returns:
image band index

getZone

public int getZone()
Get the integer ID of the image zone for which this result was calculated. If no zone image was used this method will return 0.

Returns:
integer ID of the image zone.

getStatistic

public Statistic getStatistic()
Get the statistic that this result pertains to.

Returns:
the statistic

getValue

public Double getValue()
Get the calculated value of the statistic.

Returns:
value of the statistic

getNumAccepted

public long getNumAccepted()
Get the number of values that were accepted, ie. sampled from the image and included in the calculation of this result.

Returns:
the number of values accepted

getNumOffered

public long getNumOffered()
Get the number of values that were offered, ie. sampled from the image and considered for inclusion in this result.

Returns:
number of values offered

getNumNaN

public long getNumNaN()
Get the number of NaN values that were sampled from the image when calculating this result.

Returns:
number of NaN values sampled

getNumNoData

public long getNumNoData()
Get the number of NoData values that were sampled from the image when calculating this result.

Returns:
number of NoData values sampled

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2013. All Rights Reserved.