GRASS
Class Cellstats
java.lang.Object
|
+--GRASS.Cellstats
- public class Cellstats
- extends java.lang.Object
This class wraps GRASS library struct Cell_stats (Raster Histogram).
Cell_stats is not documented in the GRASS 4.2 Programmer's Manual,
but see Section 12.10.6 Raster Histograms to learn about routines
that deal with struct Cell_stats.
|
Inner Class Summary |
class |
Cellstats.Pair
Represents a single category-count value in Cell_stats struct. |
|
Constructor Summary |
Cellstats()
Constructs an empty object and allocates memory for GRASS struct
Cell_stats. |
|
Method Summary |
long |
G_find_cell_stat(int cat)
This method allows a random query of the Cell_stats. |
Cellstats.Pair |
G_next_cell_stat()
Retrieves the next cat,count Pair. |
void |
G_rewind_cell_stats()
This object is rewound (i.e., positioned at the first raster category)
so that sorted sequential retrieval can begin. |
void |
G_update_cell_stats(CELL buf,
int n)
This routine updates the Cell_stats data
with values from the row of cell values. |
java.lang.String |
toString()
Returns a string representation of the object. |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Cellstats
public Cellstats()
- Constructs an empty object and allocates memory for GRASS struct
Cell_stats.
G_update_cell_stats
public void G_update_cell_stats(CELL buf,
int n)
- This routine updates the Cell_stats data
with values from the row of cell values.
Wraps GRASS library routine:
G_update_cell_stats (data, n, Cell_stats)
CELL *data;
int n;
struct Cell_stats *Cell_stats;
See the GRASS 4.2 Programmer's Manual,
Section 12.10.6 Raster Histogram
- Parameters:
buf - buffer of cell valuesn - number of values to be used for update
G_find_cell_stat
public long G_find_cell_stat(int cat)
throws GRASSException
- This method allows a random query of the Cell_stats.
The count associated with the raster value cat is returned.
Wraps GRASS library routine:
G_find_cell_stat (cat, count, s)
CELL cat;
long *count;
struct Cell_stats *s;
See the GRASS 4.2 Programmer's Manual,
Section 12.10.6 Raster Histogram
- Parameters:
cat - category value- Returns:
- count associated with category value
- Throws:
- GRASSException - if category value was not found in the
structure
toString
public java.lang.String toString()
- Returns a string representation of the object.
- Returns:
- String that represents this object
- Overrides:
- toString in class java.lang.Object
G_rewind_cell_stats
public void G_rewind_cell_stats()
- This object is rewound (i.e., positioned at the first raster category)
so that sorted sequential retrieval can begin.
Wraps GRASS library routine:
G_rewind_cell_stats (s)
struct Cell_stats *s;
See the GRASS 4.2 Programmer's Manual,
Section 12.10.6 Raster Histogram
G_next_cell_stat
public Cellstats.Pair G_next_cell_stat()
- Retrieves the next cat,count Pair. Returns null if there are no more
items. Must be called after G_rewind_cell_stats() was called.
Wraps GRASS library routine:
G_next_cell_stat (cat, count, s)
CELL *cat;
long *count;
struct Cell_stats *s;
See the GRASS 4.2 Programmer's Manual,
Section 12.10.6 Raster Histogram
- Returns:
- The cat-count value or null in no more categories left.
GRASS-JNI Home Page