Top Description Fields Constructors Methods
sun.jvmstat.monitor

public Class Units

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable

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

Field Summary

Modifier and TypeField and Description
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.

private static Units[]
private final String
public static final Units
NONE

Units attribute representing unit-less quantities.

private static final int
private static final long
public static final Units
STRING

Units attribute representing String data.

public static final Units
TICKS

Units attribute representing Ticks.

private final int

Constructor Summary

AccessConstructor and Description
private
Units(String name, int value)

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

int - an integer representation of this Units attribute.
intValue
()

Returns the integer representation of this Units attribute

public String

Returns:

String - a descriptive string for this enum.
toString
()

Overrides java.lang.Object.toString.

Returns a string describing this Unit of measurement attribute

public static Units

Returns:

Units - the Units object for the given value or Units#INVALID if out of range.
toUnits
(int
an integer representation of counter Units
value
)

Maps an integer value to its corresponding Units attribute.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

BYTESback to summary
public static final Units BYTES

Units attribute representing Bytes.

EVENTSback to summary
public static final Units EVENTS

Units attribute representing a count of events.

HERTZback to summary
public static final Units HERTZ

Units attribute representing Hertz (frequency).

INVALIDback to summary
public static final Units INVALID

An Invalid Units value.

mapback to summary
private static Units[] map
nameback to summary
private final String name
NONEback to summary
public static final Units NONE

Units attribute representing unit-less quantities.

NUNITSback to summary
private static final int NUNITS
serialVersionUIDback to summary
private static final long serialVersionUID
STRINGback to summary
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.

TICKSback to summary
public static final Units TICKS

Units attribute representing Ticks.

valueback to summary
private final int value

Constructor Detail

Unitsback to summary
private Units(String name, int value)

Method Detail

intValueback to summary
public int intValue()

Returns the integer representation of this Units attribute

Returns:int

int - an integer representation of this Units attribute.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string describing this Unit of measurement attribute

Returns:String

String - a descriptive string for this enum.

toUnitsback to summary
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 Units#INVALID is returned.

Parameters
value:int

an integer representation of counter Units

Returns:Units

Units - the Units object for the given value or Units#INVALID if out of range.