net.sourceforge.jiu.color.data
Interface Histogram1D
- ArrayHistogram1D
public interface Histogram1D
An interface for a one-dimensional histogram.
void | clear() - Sets all counters to zero.
|
int | getEntry(int index) - Returns the counter value for the given index.
|
int | getMaxValue() - Returns the maximum allowed index.
|
int | getNumUsedEntries() - Returns the number of used entries (those entries with
a counter value larger than zero).
|
void | increaseEntry(int index) - Increases the counter value of the given index by one.
|
void | setEntry(int index, int newValue) - Sets one counter to a new value.
|
clear
public void clear()
Sets all counters to zero.
getEntry
public int getEntry(int index)
Returns the counter value for the given index.
index
- the zero-based index of the desired counter value
getMaxValue
public int getMaxValue()
Returns the maximum allowed index.
The minimum is always 0.
getNumUsedEntries
public int getNumUsedEntries()
Returns the number of used entries (those entries with
a counter value larger than zero).
- number of non-zero counter values
increaseEntry
public void increaseEntry(int index)
Increases the counter value of the given index by one.
Same semantics as
setEntry(index, getEntry(index) + 1);
index
- index into the histogram
setEntry
public void setEntry(int index,
int newValue)
Sets one counter to a new value.
index
- index of the counter to be changednewValue
- new value for that counter