Rio Project 4.2 API Documentation



org.rioproject.watch
Class Calculable

java.lang.Object
  extended by org.rioproject.watch.Calculable
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CalculableCPU, CalculableDiskSpace, CalculableMemory, CalculableMemoryPool, CalculableProcessCPU, CalculableSystemMemory

public class Calculable
extends Object
implements Serializable

A Calculable is the atomic attribute that is being 'watched'

See Also:
Serialized Form

Constructor Summary
Calculable()
          Create a new Calculable
Calculable(String id, double value)
          Create a new Calculable that records the time
Calculable(String id, double value, long when)
          Create a new Calculable
 
Method Summary
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this one.
 String getArchiveRecord()
          Gets an archival representation for this Calculable
 Date getDate()
          Get the Date that represents the time of the Calculable
 String getDetail()
           
 String getId()
          Getter for property id
 double getValue()
          Getter for property value.
 long getWhen()
          Getter for property when.
 int hashCode()
          Returns a hash code value for the object.
 void setDetail(String detail)
           
 void setId(String id)
          Setter for property id
 void setValue(double value)
          Setter for property value.
 void setWhen(long when)
          Setter for property when.
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Calculable

public Calculable()
Create a new Calculable


Calculable

public Calculable(String id,
                  double value)
Create a new Calculable that records the time

Parameters:
id - The identifier for the Calculable
value - The value for the Calculable

Calculable

public Calculable(String id,
                  double value,
                  long when)
Create a new Calculable

Parameters:
id - The identifier for this Calculable record
value - The value for the Calculable Record
when - The time when the recorded value was captured
Method Detail

getId

public String getId()
Getter for property id

Returns:
Value of property id.

setId

public void setId(String id)
Setter for property id

Parameters:
id - New value of property id.

getValue

public double getValue()
Getter for property value.

Returns:
Value of property value.

setValue

public void setValue(double value)
Setter for property value.

Parameters:
value - New value of property value.

getWhen

public long getWhen()
Getter for property when.

Returns:
Value of property when.

setWhen

public void setWhen(long when)
Setter for property when.

Parameters:
when - New value of property when.

getDate

public Date getDate()
Get the Date that represents the time of the Calculable

Returns:
The Date that represents the time of the Calculable

getDetail

public String getDetail()

setDetail

public void setDetail(String detail)

equals

public boolean equals(Object obj)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class Object
Parameters:
obj - the object to compare to this one
Returns:
true if the objects are equal

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class Object
Returns:
a hash code value for the object.

getArchiveRecord

public String getArchiveRecord()
Gets an archival representation for this Calculable

Returns:
a string representation in archive format

toString

public String toString()
Returns a string representation of the object.

Overrides:
toString in class Object
Returns:
String representation of the object.

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.