|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.base.stats.bin.TimeSigFigSequence
public class TimeSigFigSequence
TimeSigFigSequence is similar to SigFigSequence, but is specialized for producing sequences of times. SigFigSequence produces sequences in which successive bins have different orders of magnitude, e.g., 1, 10, 100, 1000. TimeSigFigSequence has similar behavior, but instead of increasing by powers of 10, TimeSigFigSequence increases first by powers of 10 and then by units, e.g., 1 second, 10 seconds, 1 minute, 10 minutes, 1 hour, 10 hours, 1 day, 1 week, 1 month, 10 months, 1 year.
Constructor Summary | |
---|---|
TimeSigFigSequence(int sigFig,
long step)
Generate a new BinSequence object that truncates all but a specified # of significant figures from input elements. |
Method Summary | |
---|---|
Bin |
getBin(Element element)
Take an element, convert to the relevant time units, strip out all but sigFig significant figures, and build a new bin. |
Bin[] |
getBins(Element minElement,
Element maxElement)
Return a sequence of bins. |
Bin[] |
getBins(Element minElement,
Element maxElement,
boolean containsMin,
boolean containsMax)
Get 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 |
---|
public TimeSigFigSequence(int sigFig, long step)
Generate a new BinSequence object that truncates all but a specified # of significant figures from input elements. The toLong() function for each input element is assumed to yield a time in milliseconds. As with SigFigSequence, the sigFig parameter sets the number of significant figures to keep:
sigFig
- The number of significant figures to retainstep
- The step size to use in setting bin widthsMethod Detail |
---|
public Bin getBin(Element element)
getBin
in interface BinSequence
element
- The element to be mapped to a Bin
public Bin getNext(Bin bin)
getNext
in interface BinSequence
bin
- The current Bin
public Bin[] getBins(Element minElement, Element maxElement)
getBins
in interface BinSequence
minElement
- An element that should be contained in the first Bin.maxElement
- An element that should be contained in the last Bin.
public Bin[] getBins(Element minElement, Element maxElement, boolean containsMin, boolean containsMax)
getBins
in interface BinSequence
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?
public static void main(java.lang.String[] args)
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |