public abstract class AbstractDoubleBin extends PersistentObject
This class is fully thread safe (all public methods are synchronized). Thus, you can have one or more threads adding to the bin as well as one or more threads reading and viewing the statistics of the bin while it is filled. For high performance, add data in large chunks (buffers) via method addAllOf rather than piecewise via method add.
Modifier and Type | Method and Description |
---|---|
double |
center()
Returns center(0).
|
double |
center(int dimension)
Returns a custom definable "center" measure; override this method if
necessary.
|
abstract void |
clear()
Removes all elements from the receiver.
|
boolean |
equals(Object otherObj)
Returns whether two objects are equal; This default implementation
returns true if the other object is a bin and has the same size, value,
error and center.
|
double |
error()
Returns error(0).
|
double |
error(int dimension)
Returns a custom definable error measure; override this method if
necessary.
|
abstract boolean |
isRebinnable()
Returns whether a client can obtain all elements added to the receiver.
|
double |
offset()
Returns offset(0).
|
double |
offset(int dimension)
Returns the relative or absolute position for the center of the bin;
override this method if necessary.
|
abstract int |
size()
Returns the number of elements contained.
|
String |
toString()
Returns a String representation of the receiver.
|
void |
trimToSize()
Trims the capacity of the receiver to be the receiver's current size.
|
double |
value()
Returns value(0).
|
double |
value(int dimension)
Returns a custom definable "value" measure; override this method if
necessary.
|
clone
public final double center()
public double center(int dimension)
This default implementation always returns 0.5.
dimension
- the dimension to be considered (zero based).public abstract void clear()
public boolean equals(Object otherObj)
public final double error()
public double error(int dimension)
dimension
- the dimension to be considered.public abstract boolean isRebinnable()
public final double offset()
public double offset(int dimension)
This default implementation always returns 1.0 (relative).
dimension
- the index of the considered dimension (zero based);public abstract int size()
public String toString()
public void trimToSize()
public final double value()
public double value(int dimension)
This default implementation always returns 0.0.
dimension
- the dimension to be considered.Jump to the Parallel Colt Homepage