public class

Units

extends Object
implements Serializable
java.lang.Object
   ↳ sun.management.counter.Units

Class Overview

Provides a typesafe enumeration for describing units of measurement attribute for instrumentation objects.

Summary

Fields
public static final Units BYTES Units attribute representing Bytes.
public static final Units EVENTS Units attribute representing a count of events.
public static final Units HERTZ Units attribute representing Hertz (frequency).
public static final Units INVALID An Invalid Units value.
public static final Units NONE Units attribute representing unit-less quantities.
public static final Units STRING Units attribute representing String data.
public static final Units TICKS Units attribute representing Ticks.
Public Methods
int intValue()
Returns the integer representation of this Units attribute
String toString()
Returns a string describing this Unit of measurement attribute
static Units toUnits(int value)
Maps an integer value to its corresponding Units attribute.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public static final Units BYTES

Units attribute representing Bytes.

public static final Units EVENTS

Units attribute representing a count of events.

public static final Units HERTZ

Units attribute representing Hertz (frequency).

public static final Units INVALID

An Invalid Units value.

public static final Units NONE

Units attribute representing unit-less quantities.

public static final Units STRING

Units attribute representing String data. Although not really a unit of measure, this Units value serves to distinguish String instrumentation objects from instrumentation objects of other types.

public static final Units TICKS

Units attribute representing Ticks.

Public Methods

public int intValue ()

Returns the integer representation of this Units attribute

Returns
  • int - an integer representation of this Units attribute.

public String toString ()

Returns a string describing this Unit of measurement attribute

Returns
  • String - a descriptive string for this enum.

public static Units toUnits (int value)

Maps an integer value to its corresponding Units attribute. If the integer value does not have a corresponding Units enum value, then INVALID is returned.

Parameters
value an integer representation of counter Units
Returns
  • Units - the Units object for the given value or INVALID if out of range.