Package oracle.spatial.georaster
Class GeorHistogram
- java.lang.Object
-
- oracle.spatial.georaster.GeorHistogram
-
public class GeorHistogram extends java.lang.Object
GeorHistogram class is combined with class GeorHistogramEntry to represent a GeoRaster histogram, which contains an array of GeorHistogramEntry instances, and each GeorHistogramEntry contains a pair of cell value and count value.Two constructors are provided: one is the default constructor without parameters, and the other constructor allows you to specify length of GeorHistogramEntry array, in which case the constructor will create a GeorHistogramEntry array based on the length.
In this class, methods are provided for retrieving and setting the GeorHistogramEntry array and each individual entry.
The following two methods defined in the class SublayerInfo are used to retrieve and set histogram in the GeoRaster metadata through an instance of GeorHistogram:
public GeorHistogram getHistogram(); public void setHistogram(GeorHistogram histogram);
-
-
Constructor Summary
Constructors Constructor Description GeorHistogram()
Constructs aGeorHistogram
object.GeorHistogram(int length)
Constructs aGeorHistogram
object with the given array length.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long[]
getCounts()
Returns the counts array.GeorHistogramEntry
getGeorHistogramEntry(double value)
Returns a GeorHistogramEntry entry indexed by a given value.GeorHistogramEntry
getGeorHistogramEntry(int entryNo)
Returns a GeorHistogramEntry entry indexed by a given entry number.GeorHistogramEntry[]
getValueAndCount()
Returns the GeorHistogramEntry array.double[]
getValues()
Returns the values array.boolean
setValueAndCount(double[] value, long[] count)
Sets the GeorHistogramEntry array by specifying two individual component arrays.boolean
setValueAndCount(double value, int count)
Sets a GeorHistogramEntry based on value.boolean
setValueAndCount(int entryNo, double value, int count)
Sets a GeorHistogramEntry based on entryNo.boolean
setValueAndCount(GeorHistogramEntry[] entries)
Sets the GeorHistogramEntry array.
-
-
-
Method Detail
-
getValueAndCount
public GeorHistogramEntry[] getValueAndCount()
Returns the GeorHistogramEntry array.- Returns:
- GeorHistogramEntry array.
-
getValues
public double[] getValues()
Returns the values array.- Returns:
- values array.
-
getCounts
public long[] getCounts()
Returns the counts array.- Returns:
- counts array.
-
setValueAndCount
public boolean setValueAndCount(double[] value, long[] count)
Sets the GeorHistogramEntry array by specifying two individual component arrays. If the value array is not sorted in ascending order, then it will be sorted first.- Parameters:
value
- cell value arraycount
- count array- Returns:
- true or false to indicate if the set operation was successful.
-
setValueAndCount
public boolean setValueAndCount(GeorHistogramEntry[] entries)
Sets the GeorHistogramEntry array. If the value array is not sorted in ascending order, then it will be sorted first.- Parameters:
entries
- GeorHistogramEntry array- Returns:
- true or false to indicate if the set operation was successful.
-
setValueAndCount
public boolean setValueAndCount(int entryNo, double value, int count)
Sets a GeorHistogramEntry based on entryNo.- Parameters:
entryNo
- index of GeorHistogramEntry array, from 0 to (array length-1)value
- cell valuecount
- count value- Returns:
- true or false to indicate if the set operation was successful.
-
setValueAndCount
public boolean setValueAndCount(double value, int count)
Sets a GeorHistogramEntry based on value.- Parameters:
value
- cell valuecount
- count value- Returns:
- true or false to indicate if the set operation was successful.
-
getGeorHistogramEntry
public GeorHistogramEntry getGeorHistogramEntry(int entryNo)
Returns a GeorHistogramEntry entry indexed by a given entry number.- Parameters:
entryNo
- entry number- Returns:
- a GeorHistogram entry indexed by the given entry number.
-
getGeorHistogramEntry
public GeorHistogramEntry getGeorHistogramEntry(double value)
Returns a GeorHistogramEntry entry indexed by a given value.- Parameters:
value
- cell value- Returns:
- a GeorHistogram entry indexed by the given value.
-
-