Parallel Colt 0.7.2

cern.jet.stat.tdouble.quantile
Class DoubleBuffer

java.lang.Object
  extended by cern.colt.PersistentObject
      extended by cern.jet.stat.Buffer
          extended by cern.jet.stat.tdouble.quantile.DoubleBuffer
All Implemented Interfaces:
Serializable, Cloneable

public class DoubleBuffer
extends Buffer

A buffer holding double elements; internally used for computing approximate quantiles.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class cern.jet.stat.Buffer
isAllocated, k, level, weight
 
Fields inherited from class cern.colt.PersistentObject
serialVersionUID
 
Constructor Summary
DoubleBuffer(int k)
          This method was created in VisualAge.
 
Method Summary
 void add(double value)
          Adds a value to the receiver.
 void addAllOfFromTo(DoubleArrayList elements, int from, int to)
          Adds a value to the receiver.
 void clear()
          Clears the receiver.
 Object clone()
          Returns a deep copy of the receiver.
 boolean contains(double element)
          Returns whether the specified element is contained in the receiver.
 boolean isEmpty()
          Returns whether the receiver is empty.
 boolean isFull()
          Returns whether the receiver is empty.
 int memory()
          Returns the number of elements currently needed to store all contained elements.
 double rank(double element)
          Returns the rank of a given element within the sorted sequence of the receiver.
 int size()
          Returns the number of elements contained in the receiver.
 void sort()
          Sorts the receiver.
 String toString()
          Returns a String representation of the receiver.
 
Methods inherited from class cern.jet.stat.Buffer
isAllocated, isPartial, level, level, weight, weight
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DoubleBuffer

public DoubleBuffer(int k)
This method was created in VisualAge.

Parameters:
k - int
Method Detail

add

public void add(double value)
Adds a value to the receiver.


addAllOfFromTo

public void addAllOfFromTo(DoubleArrayList elements,
                           int from,
                           int to)
Adds a value to the receiver.


clear

public void clear()
Clears the receiver.

Specified by:
clear in class Buffer

clone

public Object clone()
Returns a deep copy of the receiver.

Overrides:
clone in class PersistentObject
Returns:
a deep copy of the receiver.

contains

public boolean contains(double element)
Returns whether the specified element is contained in the receiver.


isEmpty

public boolean isEmpty()
Returns whether the receiver is empty.

Specified by:
isEmpty in class Buffer

isFull

public boolean isFull()
Returns whether the receiver is empty.

Specified by:
isFull in class Buffer

memory

public int memory()
Returns the number of elements currently needed to store all contained elements. This number usually differs from the results of method size(), according to the underlying algorithm.


rank

public double rank(double element)
Returns the rank of a given element within the sorted sequence of the receiver. A rank is the number of elements <= element. Ranks are of the form {1,2,...size()}. If no element is <= element, then the rank is zero. If the element lies in between two contained elements, then uses linear interpolation.

Parameters:
element - the element to search for
Returns:
the rank of the element.

size

public int size()
Returns the number of elements contained in the receiver.

Specified by:
size in class Buffer

sort

public void sort()
Sorts the receiver.

Specified by:
sort in class Buffer

toString

public String toString()
Returns a String representation of the receiver.

Overrides:
toString in class Object

Parallel Colt 0.7.2

Jump to the Parallel Colt Homepage