org.apache.cassandra.analytics
Class MetricValue

java.lang.Object
  extended by org.apache.cassandra.analytics.MetricValue

public class MetricValue
extends java.lang.Object

A Number that is either an absolute or an incremental amount. Author : Avinash Lakshman ( alakshman@facebook.com) & Prashant Malik ( pmalik@facebook.com ) & Karthik Ranganathan ( kranganathan@facebook.com )


Field Summary
static boolean ABSOLUTE
           
static boolean INCREMENT
           
 
Constructor Summary
MetricValue(java.lang.Number number, boolean isIncrement)
          Creates a new instance of MetricValue
 
Method Summary
 java.lang.Number getNumber()
          Returns the current number value of the metric.
 boolean isAbsolute()
          Checks if the value of this metric is always an absolute value.
 boolean isIncrement()
          Checks if this metric can be incremented.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ABSOLUTE

public static final boolean ABSOLUTE
See Also:
Constant Field Values

INCREMENT

public static final boolean INCREMENT
See Also:
Constant Field Values
Constructor Detail

MetricValue

public MetricValue(java.lang.Number number,
                   boolean isIncrement)
Creates a new instance of MetricValue

Parameters:
number - this initializes the initial value of this metric
isIncrement - sets if the metric can be incremented or only set
Method Detail

isIncrement

public boolean isIncrement()
Checks if this metric can be incremented.

Returns:
true if the value of this metric can be incremented, false otherwise

isAbsolute

public boolean isAbsolute()
Checks if the value of this metric is always an absolute value. This is the inverse of isIncrement.

Returns:
true if the

getNumber

public java.lang.Number getNumber()
Returns the current number value of the metric.

Returns:
the Number value of this metric


Copyright © 2009 The Apache Software Foundation