|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.plot2.layer.Binner
public class Binner
Accumulates counts in an array of bins.
The array type starts at bytes and is dynamically adjusted to contain counts up to int size to save on memory. Is this overengineered?
Constructor Summary | |
---|---|
Binner(int n)
Constructor. |
Method Summary | |
---|---|
int |
getCount(int index)
Returns the count in a given bin. |
int |
getLength()
Returns the number of bins. |
long |
getTotal()
Returns the total number of increments made to this binner. |
void |
increment(int index)
Increments the count in a given bin by 1. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Binner(int n)
n
- number of binsMethod Detail |
---|
public int getLength()
public void increment(int index)
index
- bin indexpublic int getCount(int index)
index
- bin indexpublic long getTotal()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |