Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base.stats.bin
Class SigFigSequence

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

public class SigFigSequence
extends java.lang.Object
implements BinSequence

Generate bins by truncating all but a specified # of significant figures from an element.


Constructor Summary
SigFigSequence(int sigFig, long step)
          Generate a new BinSequence object that truncates all but a specified # of significant figures from in put elements.
 
Method Summary
 Bin getBin(Element element)
          Take an element, strip out all but sigFig significant figures, and build a new bin.
 Bin[] getBins(Element minElement, Element maxElement)
          Return a sequence of bins starting with the bin containing minElement and ending with the bin containing maxElement.
 Bin[] getBins(Element minElement, Element maxElement, boolean containsMin, boolean containsMax)
          Return a sequence of bins.
 Bin getNext(Bin bin)
          Given a Bin, return the next Bin in the sequence
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SigFigSequence

public SigFigSequence(int sigFig,
                      long step)

Generate a new BinSequence object that truncates all but a specified # of significant figures from in put elements. The sigFig parameter sets the number of significant figures to keep:

Parameters:
sigFig - The number of significant figures to retain
step - The step size to use in setting bin widths
Method Detail

getBin

public Bin getBin(Element element)
Take an element, strip out all but sigFig significant figures, and build a new bin.

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

getNext

public Bin getNext(Bin bin)
Given a Bin, return the next Bin in the sequence

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

getBins

public Bin[] getBins(Element minElement,
                     Element maxElement)
Return a sequence of bins starting with the bin containing minElement and ending with the bin containing maxElement.

Specified by:
getBins in interface BinSequence
Parameters:
minElement - An element contained in the first bin
maxElement - An element contained in the last bin
Returns:
The resulting array of Bins

getBins

public Bin[] getBins(Element minElement,
                     Element maxElement,
                     boolean containsMin,
                     boolean containsMax)
Return 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

main

public static void main(java.lang.String[] args)

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.