org.opensolaris.os.dtrace
Class SumValue

java.lang.Object
  extended by org.opensolaris.os.dtrace.SumValue
All Implemented Interfaces:
java.io.Serializable, AggregationValue

public final class SumValue
extends java.lang.Object

A long value aggregated by the DTrace sum() action.

Immutable. Supports persistence using XMLEncoder.

See Also:
Aggregation, Serialized Form

Constructor Summary
SumValue(long v)
          Creates a value aggregated by the DTrace sum() action.
 
Method Summary
 boolean equals(java.lang.Object o)
          Compares the specified object with this aggregation value for equality.
 java.lang.Long getValue()
          Gets the sum total of the aggregated values.
 int hashCode()
          Overridden to ensure that equal instances have equal hash codes.
 java.lang.String toString()
          Gets the string representation of getValue().
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SumValue

public SumValue(long v)
Creates a value aggregated by the DTrace sum() action. Supports XML persistence.

Parameters:
v - sum total of the aggregated values
Method Detail

getValue

public java.lang.Long getValue()
Gets the sum total of the aggregated values.

Specified by:
getValue in interface AggregationValue
Returns:
the sum total of the aggregated values

equals

public boolean equals(java.lang.Object o)
Compares the specified object with this aggregation value for equality. Defines equality as having the same type and the same numeric value.

Overrides:
equals in class java.lang.Object
Returns:
true if and only if the specified object is an aggregation value of the same Class as this value, and both values return equal numbers from getValue().

hashCode

public int hashCode()
Overridden to ensure that equal instances have equal hash codes.

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Gets the string representation of getValue().

Overrides:
toString in class java.lang.Object
Returns:
the string representation of getValue() returned by Object.toString()