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 Aggregate

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

All Implemented Interfaces:
  java.io.Serializable

    public final class Aggregate

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

A consistent snapshot of all aggregations requested by a single `Consumer`.

Immutable. Supports persistence using `XMLEncoder`.

See Also:
  `Consumer.getAggregate()`, Serialized Form

Constructor Summary
`Aggregate(long snaptimeNanos, java.util.Collection<Aggregation> aggregations)` Creates an aggregate with the given snaptime and aggregations.

Method Summary
`java.util.Map<java.lang.String,Aggregation>` | `asMap()` Gets a read-only `Map` view of this aggregate.
`Aggregation` | `getAggregation(java.lang.String name)` Gets the aggregation with the given name if it exists in this aggregate snapshot.
`java.util.List<Aggregation>` | `getAggregations()` Gets an unordered list of all aggregations in this aggregate snapshot.
`long` | `getSnaptime()` Gets the nanosecond timestamp of this aggregate snapshot.
`java.lang.String` | `toString()` Gets a string representation of this aggregate snapshot useful for logging and not intended for display.

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

Constructor Detail

### Aggregate

    public Aggregate(long snaptimeNanos,
                     java.util.Collection<Aggregation> aggregations)

  Creates an aggregate with the given snaptime and aggregations. Supports XML persistence.

  Parameters:
    `snaptimeNanos` - nanosecond timestamp when this aggregate was snapped
    `aggregations` - unordered collection of aggregations belonging to this aggregate
  Throws:
    `java.lang.NullPointerException` - if the given collection of aggregations is `null`

Method Detail

### getSnaptime

    public long getSnaptime()

  Gets the nanosecond timestamp of this aggregate snapshot.

  Returns:
    nanosecond timestamp of this aggregate snapshot

### getAggregations

    public java.util.List<Aggregation> getAggregations()

  Gets an unordered list of all aggregations in this aggregate snapshot. The list is easily sortable using `Collections.sort(List list, Comparator c)` provided any user-defined ordering. Modifying the returned list has no effect on this aggregate. Supports XML persistence.

  Returns:
    modifiable unordered list of all aggregations in this aggregate snapshot; list is non-null and possibly empty

### getAggregation

    public Aggregation getAggregation(java.lang.String name)

  Gets the aggregation with the given name if it exists in this aggregate snapshot.

  Parameters:
    `name` - the name of the desired aggregation, or empty string to request the unnamed aggregation. In D, the unnamed aggregation is used anytime a name does not follow the aggregation symbol '`@`', for example:

                  @ = count();

    as opposed to

                  @counts = count()

    resulting in an `Aggregation` with the name "counts".
  Returns:
    `null` if no aggregation by the given name exists in this aggregate
  See Also:
    `Aggregation.getName()`

### asMap

    public java.util.Map<java.lang.String,Aggregation> asMap()

  Gets a read-only `Map` view of this aggregate.

  Returns:
    a read-only `Map` view of this aggregate keyed by aggregation name

### toString

    public java.lang.String toString()

  Gets a string representation of this aggregate snapshot 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