Venice 0.751beta

nz.org.venice.ui
Class PointChangeFormat

java.lang.Object
  extended bynz.org.venice.ui.PointChangeFormat
All Implemented Interfaces:
java.lang.Comparable

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

Representation of a quote's point change for display in a table. This class is used by the AbstractTable class to identify the value type so that it can render the value correctly. If the day close of a stock today is 30.0 and the day close of the stock yesterday was 29.0, then today's point change is +1.

Author:
Andrew Leppard

Constructor Summary
PointChangeFormat(double change)
          Create a new point change format object.
PointChangeFormat(double initialValue, double finalValue)
          Create a new point change format object.
PointChangeFormat(double initialValue, double finalValue, boolean isIndex)
          Create a new point change format object.
 
Method Summary
 int compareTo(java.lang.Object object)
          Compare two change objects.
 double getPointChange()
          Return the point change.
 java.lang.String toString()
          Create a string representation of the point change.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PointChangeFormat

public PointChangeFormat(double change)
Create a new point change format object.

Parameters:
change - the point change.

PointChangeFormat

public PointChangeFormat(double initialValue,
                         double finalValue)
Create a new point change format object.

Parameters:
initialValue - the initial quote value
finalValue - the final quote value

PointChangeFormat

public PointChangeFormat(double initialValue,
                         double finalValue,
                         boolean isIndex)
Create a new point change format object.

Parameters:
initialValue - the initial quote value
finalValue - the final quote value
isIndex - if the source of the change is an index.
Method Detail

getPointChange

public double getPointChange()
Return the point change.

Returns:
the point change.

toString

public java.lang.String toString()
Create a string representation of the point change.

Returns:
string representation of the point change.

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.751beta