APIdia Launch Partner
Top Description Fields Constructors Methods
sun.management

public abstract Class Sensor

extends Object
Class Inheritance
Known Direct Subclasses
sun.management.MemoryPoolImpl.PoolSensor, sun.management.MemoryPoolImpl.CollectionSensor
Imports
java.lang.management.MemoryUsage, java.util.Iterator, .Map, .HashMap

An abstract sensor.

An AbstractSensor object consists of two attributes:

Author
Mandy Chung
Since
1.5

Field Summary

Modifier and TypeField and Description
private long
private final Object
private final String
private boolean

Constructor Summary

AccessConstructor and Description
public
Sensor(String
The name of this sensor.
name
)

Constructs a Sensor object.

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Clears this sensor.

public void
clear(int increment)

Clears this sensor and increments the count with the input increment.

pack-priv abstract void
public long

Returns:

the total number of times that this sensor has been triggered.
getCount
()

Returns the total number of times that this sensor has been triggered.

public String

Returns:

the name of this sensor.
getName
()

Returns the name of this sensor.

public boolean

Returns:

true if the sensor is currently on; false otherwise.
isOn
()

Tests if this sensor is currently on.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public void
trigger()

Triggers this sensor.

public void
trigger(int increment)

Triggers this sensor.

public void
trigger(int increment, MemoryUsage usage)

Triggers this sensor piggybacking a memory usage object.

pack-priv abstract void
pack-priv abstract void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

countback to summary
private long count
lockback to summary
private final Object lock
nameback to summary
private final String name
onback to summary
private boolean on

Constructor Detail

Sensorback to summary
public Sensor(String name)

Constructs a Sensor object.

Parameters
name:String

The name of this sensor.

Method Detail

clearback to summary
public void clear()

Clears this sensor.

clearback to summary
public void clear(int increment)

Clears this sensor and increments the count with the input increment.

clearActionback to summary
pack-priv abstract void clearAction()
getCountback to summary
public long getCount()

Returns the total number of times that this sensor has been triggered.

Returns:long

the total number of times that this sensor has been triggered.

getNameback to summary
public String getName()

Returns the name of this sensor.

Returns:String

the name of this sensor.

isOnback to summary
public boolean isOn()

Tests if this sensor is currently on.

Returns:boolean

true if the sensor is currently on; false otherwise.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

triggerback to summary
public void trigger()

Triggers this sensor. This method first sets this sensor on and increments its sensor count.

triggerback to summary
public void trigger(int increment)

Triggers this sensor. This method sets this sensor on and increments the count with the input increment.

triggerback to summary
public void trigger(int increment, MemoryUsage usage)

Triggers this sensor piggybacking a memory usage object. This method sets this sensor on and increments the count with the input increment.

triggerActionback to summary
pack-priv abstract void triggerAction()
triggerActionback to summary
pack-priv abstract void triggerAction(MemoryUsage u)