com.ibm.websphere.fabric.da.types
Class Cost

java.lang.Object
  extended by com.ibm.websphere.fabric.da.types.Cost
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public abstract class Cost
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable

Represents the cost of usage (of a particular service). All concrete subclasses of cost must implement getCostPerMinute() so that costs can be compared against threshold values within Dynamic Assembler extensions.

Instances of this type are immutable, and therefore thread-safe.

Costs, while comparable, do not implement meaningful versions of Object.equals(Object) and Object.hashCode(). Thus they should not be used as keys of hash-based maps.

Version:
$Id: $
Author:
dranatunga
See Also:
Serialized Form

Field Summary
static float EPSILON
          The precision below which differences in cost per minute are considered negligible.
 
Constructor Summary
Cost()
           
 
Method Summary
 int compareTo(java.lang.Object obj)
          See Comparable.compareTo(Object).
abstract  float getCostPerMinute()
          Expresses the cost as a cost-per-minute of subscription.
 java.lang.String toString()
          Current implementation prints the value of getCostPerMinute().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EPSILON

public static final float EPSILON
The precision below which differences in cost per minute are considered negligible.

See Also:
Constant Field Values
Constructor Detail

Cost

public Cost()
Method Detail

getCostPerMinute

public abstract float getCostPerMinute()
Expresses the cost as a cost-per-minute of subscription. Concrete subclasses of cost may carry more detailed information.

Returns:
a non-NaN cost. (See Float.NaN.)

compareTo

public int compareTo(java.lang.Object obj)
See Comparable.compareTo(Object).

Specified by:
compareTo in interface java.lang.Comparable

toString

public java.lang.String toString()
Current implementation prints the value of getCostPerMinute(). See Object.toString()

Overrides:
toString in class java.lang.Object


Copyright © 2002-2009 IBM. All Rights Reserved.