Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javatools.util
Class FormattedNumber  view FormattedNumber download FormattedNumber.java

java.lang.Object
  extended byjava.lang.Number
      extended byjavatools.util.FormattedNumber
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
FormattedInteger, FormattedLong

public abstract class FormattedNumber
extends java.lang.Number

It's a java.lang.Number, except in the fact it returns its "toString" value in a formatted way.

Version:
0.0.1

Field Summary
protected  java.text.DecimalFormat formatter
          The formatter.
protected  java.lang.Number num
          The number to use.
 
Fields inherited from class java.lang.Number
 
Constructor Summary
FormattedNumber()
          Creates new FormattedNumber
 
Method Summary
 byte byteValue()
          Returns the byte value for out num object.
 double doubleValue()
          Returns the double value for out num object.
 boolean equals(java.lang.Object obj)
          Checks if an object is equal to our num object.
 float floatValue()
          Returns the float value for out num object.
 java.text.DecimalFormat getFormatter()
          Returns the currently using formatter.
 int hashCode()
          Returns the hash code for the num object.
 int intValue()
          Returns the int value for out num object.
 long longValue()
          Returns the long value for out num object.
 void setFormatter(java.text.DecimalFormat pFormatter)
          Sets the formatter to use.
 short shortValue()
          Returns the short value for out num object.
 java.lang.String toString()
          Returns a formatted string representing the contained number.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

num

protected java.lang.Number num
The number to use.


formatter

protected java.text.DecimalFormat formatter
The formatter.

Constructor Detail

FormattedNumber

public FormattedNumber()
Creates new FormattedNumber

Method Detail

hashCode

public int hashCode()
Returns the hash code for the num object.


toString

public java.lang.String toString()
Returns a formatted string representing the contained number.


equals

public boolean equals(java.lang.Object obj)
Checks if an object is equal to our num object.


byteValue

public byte byteValue()
Returns the byte value for out num object.


doubleValue

public double doubleValue()
Returns the double value for out num object.


floatValue

public float floatValue()
Returns the float value for out num object.


intValue

public int intValue()
Returns the int value for out num object.


longValue

public long longValue()
Returns the long value for out num object.


shortValue

public short shortValue()
Returns the short value for out num object.


setFormatter

public void setFormatter(java.text.DecimalFormat pFormatter)
Sets the formatter to use.


getFormatter

public java.text.DecimalFormat getFormatter()
Returns the currently using formatter.