All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pnuts.ext.Fraction

pnuts.ext.Fraction

public class Fraction
implements Numeric
An implementation of fractional number. This class is an examples of pnuts.lang.Numeric and pnuts.lang.QuantityFactory. A sample script to use this class is here.


Constructor Index

 o Fraction(int, int)
 o Fraction(Number, Number)

Method Index

 o add(Object)
 o compareTo(Object)
 o divide(Object)
 o doubleValue()
 o floatValue()
 o getDenominator()
 o getNumerator()
 o intValue()
 o inverse()
 o longValue()
 o make(int, int)
 o make(Number, Number)
 o multiply(Object)
 o negate()
 o subtract(Object)
 o toString()

Constructors

 o Fraction
 protected Fraction(int num,
                    int den)
 o Fraction
 protected Fraction(Number num,
                    Number den)

Methods

 o make
 public static Number make(int num,
                           int den)
 o make
 public static Number make(Number num,
                           Number den)
 o getDenominator
 public Number getDenominator()
 o getNumerator
 public Number getNumerator()
 o intValue
 public int intValue()
 o longValue
 public long longValue()
 o floatValue
 public float floatValue()
 o doubleValue
 public double doubleValue()
 o add
 public Object add(Object o)
 o subtract
 public Object subtract(Object o)
 o multiply
 public Object multiply(Object o)
 o divide
 public Object divide(Object o)
 o negate
 public Object negate()
 o inverse
 public Object inverse()
 o compareTo
 public int compareTo(Object o)
 o toString
 public String toString()

All Packages  Class Hierarchy  This Package  Previous  Next  Index