com.rubecula.darwin.foundation
Class MutableValuable

java.lang.Object
  extended by com.rubecula.darwin.foundation.MutableValuable
All Implemented Interfaces:
Valuable, net.sf.tostring0.Identifiable

public class MutableValuable
extends java.lang.Object
implements Valuable

Author:
Robin Hillyard TODO consider using MutableDouble instead.

Constructor Summary
MutableValuable(double value)
           
MutableValuable(java.lang.Number value)
           
 
Method Summary
 java.lang.String getIdentifier()
           
 java.lang.Number getValue()
          Get the value which we can use to compare this object with other Valuable objects, for example in conjunction with Best interface.
 void scaleValue(double factor)
           
 void scaleValue(java.lang.Number factor)
           
 void setValue(double value)
          Reset the value according to the value of Number.doubleValue()
 void setValue(java.lang.Number value)
          Reset the value according to the value of Number.doubleValue()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MutableValuable

public MutableValuable(double value)
Parameters:
value - XXX

MutableValuable

public MutableValuable(java.lang.Number value)
Parameters:
value - XXX
Method Detail

getIdentifier

public java.lang.String getIdentifier()
Specified by:
getIdentifier in interface net.sf.tostring0.Identifiable
See Also:
Identifiable.getIdentifier()

getValue

public java.lang.Number getValue()
                          throws ValueException
Description copied from interface: Valuable
Get the value which we can use to compare this object with other Valuable objects, for example in conjunction with Best interface. NOTE: that this method gets called a lot. Therefore, if invoking it requires a significant amount of work, the Valuable implementation should consider caching the value.

Specified by:
getValue in interface Valuable
Returns:
the value for this object which will be used to determine which is the "best".
Throws:
ValueException
See Also:
Valuable.getValue()

scaleValue

public void scaleValue(double factor)
Parameters:
factor -

scaleValue

public void scaleValue(java.lang.Number factor)
Parameters:
factor -

setValue

public void setValue(double value)
Reset the value according to the value of Number.doubleValue()

Parameters:
value -

setValue

public void setValue(java.lang.Number value)
Reset the value according to the value of Number.doubleValue()

Parameters:
value -


Copyright © 2010 Rubecula Software, LLC. All Rights Reserved.