Venice 0.7beta

org.mov.ui
Class ChangeFormat

java.lang.Object
  extended by org.mov.ui.ChangeFormat
All Implemented Interfaces:
java.lang.Comparable

public class ChangeFormat
extends java.lang.Object
implements java.lang.Comparable

An abstract representation of the concept of Change. This class stores the change of a value (in percent). It is currently used as a place holder for the class SortedTable to allow us to differentiate it from the other double values used in that object. This way we can format it differently.


Constructor Summary
ChangeFormat(double change)
          Create a new Change object from the given change.
ChangeFormat(double initialValue, double finalValue)
          Create a new change object and calculate the change from the initial and final monetary values.
ChangeFormat(Money initialValue, Money finalValue)
          Create a new change object and calculate the change from the initial and final monetary values.
 
Method Summary
 int compareTo(java.lang.Object object)
          Compare two change objects.
 double getChange()
          Get the change percent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChangeFormat

public ChangeFormat(double change)
Create a new Change object from the given change.

Parameters:
change - the change in percent

ChangeFormat

public ChangeFormat(Money initialValue,
                    Money finalValue)
Create a new change object and calculate the change from the initial and final monetary values.

Parameters:
initialValue - the initial amount
finalValue - the final amount

ChangeFormat

public ChangeFormat(double initialValue,
                    double finalValue)
Create a new change object and calculate the change from the initial and final monetary values.

Parameters:
initialValue - the initial amount
finalValue - the final amount
Method Detail

getChange

public double getChange()
Get the change percent.

Returns:
the change in percent

compareTo

public int compareTo(java.lang.Object object)
Compare two change objects.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
object - change object to compare to
Returns:
the value 0 if the change objects are equal; 1 if this change object is after the specified change object or -1 if this change object is before the specified change object

Venice 0.7beta