Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base.stats.bin
Class VariableStepSequence

java.lang.Object
  extended by com.jivesoftware.base.stats.bin.VariableStepSequence
All Implemented Interfaces:
BinSequence

public class VariableStepSequence
extends java.lang.Object
implements BinSequence

A sequence of bins in which step size remains constant over fixed intervals. For example, we can specify a step size of 1 between 0 and 5, then a step size of 5 between 5 and 20, then a step size of 20 between 20 and 100.


Constructor Summary
VariableStepSequence(long[] lowerLimit, long[] step)
          Creates new VariableStepSequence.
 
Method Summary
 Bin getBin(Element element)
          Map an Element to a Bin.
 Bin[] getBins(Element minElement, Element maxElement)
          Get a sequence of Bins.
 Bin[] getBins(Element minElement, Element maxElement, boolean containsMin, boolean containsMax)
          Get a sequence of Bins.
 Bin getNext(Bin bin)
          Get the next Bin in the sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VariableStepSequence

public VariableStepSequence(long[] lowerLimit,
                            long[] step)
Creates new VariableStepSequence. The step array specifies a set of step sizes. The lowerLimit array specifies the lower limit of the range over which the step is used. For example, the following values result in a step size of 1 between 0 and 5, then a step size of 5 between 5 and 20, then a step size of 25 above 20. long[] lowerLimit = {0, 5, 20}; long[] step = {1, 5, 25};

Parameters:
lowerLimit - A set of lower limits on a set of ranges of numbers. lowerLimit must contain a strictly increasing sequence.
step - The sequence of step sizes for each range.
Method Detail

getBin

public Bin getBin(Element element)
Map an Element to a Bin.

Specified by:
getBin in interface BinSequence
Parameters:
element - The element to be mapped to a Bin
Returns:
The resulting Bin

getBins

public Bin[] getBins(Element minElement,
                     Element maxElement)
Get a sequence of Bins.

Specified by:
getBins in interface BinSequence
Parameters:
minElement - An element that should be contained in the first Bin.
maxElement - An element that should be contained in the last Bin.
Returns:
The resulting array of Bins

getBins

public Bin[] getBins(Element minElement,
                     Element maxElement,
                     boolean containsMin,
                     boolean containsMax)
Get a sequence of Bins.

Specified by:
getBins in interface BinSequence
Parameters:
minElement - An element that defines the first Bin.
maxElement - An element that defines the last Bin.
containsMin - Should the list contain the first Bin?
containsMax - Should the list contain the last Bin?
Returns:
The resulting array of Bins

getNext

public Bin getNext(Bin bin)
Get the next Bin in the sequence.

Specified by:
getNext in interface BinSequence
Parameters:
bin - The current Bin
Returns:
The next Bin

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.