Class Calculable

java.lang.Object
org.jini.rio.watch.Calculable
All Implemented Interfaces:
Serializable

public class Calculable extends Object implements Serializable
A Calculable implements support required by the Calculable interface
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected String
    The identifier for the Calculable
    protected double
    The value for the Calculable
    protected long
    Holds value of property when, which indicates when the Calculable was recorded
  • Constructor Summary

    Constructors
    Constructor
    Description
    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

    Modifier and Type
    Method
    Description
    boolean
    Indicates whether some other object is "equal to" this one.
    Gets an archival representation for this Calculable
    Getter for property id
    double
    Getter for property value.
    long
    Getter for property when.
    int
    Returns a hash code value for the object.
    void
    Setter for property id
    void
    setValue(double value)
    Setter for property value.
    void
    setWhen(long when)
    Setter for property when.
    Returns a string representation of the object.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • id

      protected String id
      The identifier for the Calculable
    • value

      protected double value
      The value for the Calculable
    • when

      protected long when
      Holds value of property when, which indicates when the Calculable was recorded
  • Constructor Details

    • 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 Details

    • 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.
    • 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.