net.sf.myra.framework
Class NumericCost

java.lang.Object
  extended by net.sf.myra.framework.NumericCost
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<Cost>, Cost

public class NumericCost
extends java.lang.Object
implements Cost

Default numeric cost implementation. Note that this implementation assumes that bigger values are better than smaller values.

Version:
$Revision$ $Date:: $
Author:
Fernando Esteban Barril Otero
See Also:
Serialized Form

Constructor Summary
NumericCost(double value)
          Default constructor.
 
Method Summary
 NumericCost clone()
          Creates and returns a copy of this cost instance.
 int compareTo(Cost o)
           
 int compareTo(NumericCost o)
           
 double getValue()
          Returns the cost value.
static boolean isNumber(double value)
          Tests if the specified value is a number.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NumericCost

public NumericCost(double value)
Default constructor.

Parameters:
value - the cost value.
Method Detail

getValue

public double getValue()
Returns the cost value.

Specified by:
getValue in interface Cost
Returns:
the cost value.

compareTo

public int compareTo(Cost o)
Specified by:
compareTo in interface java.lang.Comparable<Cost>

compareTo

public int compareTo(NumericCost o)

clone

public NumericCost clone()
Description copied from interface: Cost
Creates and returns a copy of this cost instance.

Specified by:
clone in interface Cost
Overrides:
clone in class java.lang.Object
Returns:
a copy of this cost instance.

isNumber

public static boolean isNumber(double value)
Tests if the specified value is a number.

Parameters:
value - the value to be tested.
Returns:
true if the value is a number; false otherwise.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2013. All Rights Reserved.