|
JIU 0.14.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.jiu.color.data.ArrayHistogram1D
public class ArrayHistogram1D
A one-dimensional histogram data class that stores its counters in memory.
Counters are stored in an int
array of length
getMaxValue()
+ 1
so that k
values will require k * 4
bytes.
Constructor Summary | |
---|---|
ArrayHistogram1D(int numValues)
Creates a histogram with the argument's number of values, from 0 to numValues - 1 . |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArrayHistogram1D(int numValues)
0
to numValues - 1
.
numValues
- the number of counters in the histogram; must be one or larger
IllegalArgumentException
- if the argument is smaller than oneMethod Detail |
---|
public void clear()
Histogram1D
clear
in interface Histogram1D
public int getEntry(int index)
Histogram1D
getEntry
in interface Histogram1D
index
- the zero-based index of the desired counter value
public int getMaxValue()
Histogram1D
getMaxValue
in interface Histogram1D
public int getNumUsedEntries()
Histogram1D
getNumUsedEntries
in interface Histogram1D
public void increaseEntry(int index)
Histogram1D
setEntry(index, getEntry(index) + 1);
increaseEntry
in interface Histogram1D
index
- index into the histogrampublic void setEntry(int index, int newValue)
Histogram1D
setEntry
in interface Histogram1D
index
- index of the counter to be changednewValue
- new value for that counter
|
JIU 0.14.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |