org.shiftone.jrat.util
Class Percent

java.lang.Object
  extended by java.lang.Number
      extended by org.shiftone.jrat.util.Percent
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public class Percent
extends java.lang.Number
implements java.lang.Comparable

Author:
jeff@shiftone.org (Jeff Drost)
See Also:
Serialized Form

Field Summary
static Percent HUNDRED
           
static double MAX_VALUE
           
static double MIN_VALUE
           
static double NAN
           
static double NEGATIVE_INFINITY
           
static double POSITIVE_INFINITY
           
static Percent ZERO
           
 
Constructor Summary
Percent(double value)
           
Percent(java.lang.String s)
           
 
Method Summary
 byte byteValue()
           
 int compareTo(java.lang.Object o)
           
 int compareTo(Percent anotherPercent)
           
 double doubleValue()
           
 boolean equals(java.lang.Object obj)
           
 float floatValue()
           
 int hashCode()
           
 int intValue()
           
 boolean isInfinite()
           
static boolean isInfinite(double v)
           
 boolean isNaN()
           
static boolean isNaN(double v)
           
 long longValue()
           
static double parseDouble(java.lang.String s)
           
 short shortValue()
           
 java.lang.String toString()
           
static java.lang.String toString(double d)
           
static Percent valueOf(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ZERO

public static final Percent ZERO

HUNDRED

public static final Percent HUNDRED

POSITIVE_INFINITY

public static final double POSITIVE_INFINITY
See Also:
Constant Field Values

NEGATIVE_INFINITY

public static final double NEGATIVE_INFINITY
See Also:
Constant Field Values

NAN

public static final double NAN
See Also:
Constant Field Values

MAX_VALUE

public static final double MAX_VALUE
See Also:
Constant Field Values

MIN_VALUE

public static final double MIN_VALUE
See Also:
Constant Field Values
Constructor Detail

Percent

public Percent(double value)

Percent

public Percent(java.lang.String s)
        throws java.lang.NumberFormatException
Throws:
java.lang.NumberFormatException
Method Detail

toString

public static java.lang.String toString(double d)

valueOf

public static Percent valueOf(java.lang.String s)
                       throws java.lang.NumberFormatException
Throws:
java.lang.NumberFormatException

parseDouble

public static double parseDouble(java.lang.String s)
                          throws java.lang.NumberFormatException
Throws:
java.lang.NumberFormatException

isNaN

public static boolean isNaN(double v)

isInfinite

public static boolean isInfinite(double v)

isNaN

public boolean isNaN()

isInfinite

public boolean isInfinite()

toString

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

byteValue

public byte byteValue()
Overrides:
byteValue in class java.lang.Number

shortValue

public short shortValue()
Overrides:
shortValue in class java.lang.Number

intValue

public int intValue()
Specified by:
intValue in class java.lang.Number

longValue

public long longValue()
Specified by:
longValue in class java.lang.Number

floatValue

public float floatValue()
Specified by:
floatValue in class java.lang.Number

doubleValue

public double doubleValue()
Specified by:
doubleValue in class java.lang.Number

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(Percent anotherPercent)

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable