org.exoplatform.commons.utils
Class LongSampler

java.lang.Object
  extended by org.exoplatform.commons.utils.BoundedBuffer<java.lang.Long>
      extended by org.exoplatform.commons.utils.LongSampler
All Implemented Interfaces:
java.lang.Iterable<java.lang.Long>

public class LongSampler
extends BoundedBuffer<java.lang.Long>

An object that sample long values.

Version:
$Revision$
Author:
Julien Viet

Constructor Summary
LongSampler(int maxSize)
           
 
Method Summary
 double average()
          Returns the average value.
 int countAboveThreshold(long threshold)
          Returns the number of values which are greater or equals to the threshold value.
 
Methods inherited from class org.exoplatform.commons.utils.BoundedBuffer
add, getMaxSize, getSize, iterator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LongSampler

public LongSampler(int maxSize)
Method Detail

average

public double average()
Returns the average value.

Returns:
the average

countAboveThreshold

public int countAboveThreshold(long threshold)
Returns the number of values which are greater or equals to the threshold value.

Parameters:
threshold - the threshold value
Returns:
the count of values above the provided threshold


Copyright © 2011 eXo Platform SAS. All Rights Reserved.