Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.opensolaris.os.dtrace
Class AggregationRecord

    java.lang.Object
      org.opensolaris.os.dtrace.AggregationRecord

All Implemented Interfaces:
  java.io.Serializable, Record

    public final class AggregationRecord

extends java.lang.Object
implements Record, java.io.Serializable

A single key-value pair in a DTrace aggregation.

Immutable. Supports persistence using `XMLEncoder`.

See Also:
  `Aggregation`, Serialized Form

Constructor Summary
`AggregationRecord(Tuple tupleKey, AggregationValue recordValue)` Creates an aggregation record with the given key and value.

Method Summary
`boolean` | `equals(java.lang.Object o)` Compares the specified object with this aggregation record for equality.
`Tuple` | `getTuple()` Gets the multi-element key associated with `getValue()`.
`AggregationValue` | `getValue()` Gets the value associated with `getTuple()`.
`int` | `hashCode()` Overridden to ensure that equal records have equal hash codes.
`java.lang.String` | `toString()` Gets a string representation of this aggregation record useful for logging and not intended for display.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### AggregationRecord

    public AggregationRecord(Tuple tupleKey,
                             AggregationValue recordValue)

  Creates an aggregation record with the given key and value. Supports XML persistence.

  Parameters:
    `tupleKey` - aggregation tuple, may be empty (see `Tuple.EMPTY`) to indicate that this record's value belongs to an unkeyed aggregation declared without square brackets, for example:

                 @a = count();

    `recordValue` - aggregated value associated with the given tuple
  Throws:
    `java.lang.NullPointerException` - if the given key or value is `null`

Method Detail

### getTuple

    public Tuple getTuple()

  Gets the multi-element key associated with `getValue()`.

  Returns:
    non-null, possibly empty tuple
  See Also:
    `Aggregation.getRecord(Tuple key)`

### getValue

    public AggregationValue getValue()

  Gets the value associated with `getTuple()`. Values generated by the DTrace actions `count()`, `sum()`, `avg()`, `min()`, and `max()` are of type `Long`. Values generated by the DTrace actions `quantize(`) and `lquantize()` are of type `Distribution`.

  Returns:
    non-null value keyed to `getTuple()`

### equals

    public boolean equals(java.lang.Object o)

  Compares the specified object with this aggregation record for equality. Defines equality as having the same tuple and value.

  Overrides:
    `equals` in class `java.lang.Object`
  Returns:
    `true` if and only if the specified object is an `AggregationRecord` and both records have equal tuples as defined by `Tuple.equals(Object o)` and equal values as defined by the implementation of `AggregationValue`

### hashCode

    public int hashCode()

  Overridden to ensure that equal records have equal hash codes.

  Overrides:
    `hashCode` in class `java.lang.Object`

### toString

    public java.lang.String toString()

  Gets a string representation of this aggregation record useful for logging and not intended for display. The exact details of the representation are unspecified and subject to change, but the following format may be regarded as typical:

       class-name[property1 = value1, property2 = value2]

  Overrides:
    `toString` in class `java.lang.Object`

Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD