Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base.stats.bin
Class RegularSequence

java.lang.Object
  extended by com.jivesoftware.base.stats.bin.RegularSequence
All Implemented Interfaces:
BinSequence
Direct Known Subclasses:
DateSequence

public class RegularSequence
extends java.lang.Object
implements BinSequence

Generates a regularly spaced sequence of Bins.


Constructor Summary
RegularSequence(Element step)
          Create a BinSequence that will generate a sequence of regularly spaced intervals.
RegularSequence(Element begin, Element step)
          Create a BinSequence that will generate a sequence of regularly spaced intervals.
 
Method Summary
 Bin getBin(Element element)
          Get the Bin for the specified Element.
 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 starting at minElement and ending with maxElement.
 Bin getNext(Bin bin)
          Get the next bin in the sequence following the specified bin
 Element getStep()
          Get the interval step size for this sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegularSequence

public RegularSequence(Element begin,
                       Element step)

Create a BinSequence that will generate a sequence of regularly spaced intervals. The precision of elements is truncated to begin + K * step where K is an integer. The step parameter sets the width of the intervals to be generated.

Parameters:
begin - The zero point for the sequence
step - The step size between each interval

RegularSequence

public RegularSequence(Element step)
Create a BinSequence that will generate a sequence of regularly spaced intervals.

Parameters:
step - The step size between each interval
Method Detail

getStep

public Element getStep()
Get the interval step size for this sequence.


getBin

public Bin getBin(Element element)
Get the Bin for the specified Element.

Specified by:
getBin in interface BinSequence
Parameters:
element - Element to be placed in a Bin
Returns:
A Bin containing the given Element, or null if element is outside the range for the sequence

getNext

public Bin getNext(Bin bin)
Get the next bin in the sequence following the specified bin

Specified by:
getNext in interface BinSequence
Parameters:
bin - Current bin in the sequence
Returns:
Next bin in the sequence

getBins

public Bin[] getBins(Element minElement,
                     Element maxElement)
Description copied from interface: BinSequence
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 starting at minElement and ending with maxElement.

Specified by:
getBins in interface BinSequence
Parameters:
minElement - An element used to define the beginning of the sequence
maxElement - An element used to define the end of the sequence
containsMin - Should the list contain the first Bin?
containsMax - Should the list contain the last Bin?
Returns:
The resulting array of Bins

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.