com.jhlabs.map
Class Unit

java.lang.Object
  extended by com.jhlabs.map.Unit
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DegreeUnit

public class Unit
extends Object
implements Serializable

See Also:
Serialized Form

Field Summary
 String abbreviation
           
static int ANGLE_UNIT
           
static int AREA_UNIT
           
static NumberFormat format
           
static int LENGTH_UNIT
           
 String name
           
 String plural
           
 double value
           
static int VOLUME_UNIT
           
 
Constructor Summary
Unit(String name, String plural, String abbreviation, double value)
           
 
Method Summary
 boolean equals(Object o)
           
 String format(double n)
           
 String format(double n, boolean abbrev)
           
 String format(double x, double y)
           
 String format(double x, double y, boolean abbrev)
           
 double fromBase(double n)
           
 double parse(String s)
           
 double toBase(double n)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ANGLE_UNIT

public static final int ANGLE_UNIT
See Also:
Constant Field Values

LENGTH_UNIT

public static final int LENGTH_UNIT
See Also:
Constant Field Values

AREA_UNIT

public static final int AREA_UNIT
See Also:
Constant Field Values

VOLUME_UNIT

public static final int VOLUME_UNIT
See Also:
Constant Field Values

name

public String name

plural

public String plural

abbreviation

public String abbreviation

value

public double value

format

public static NumberFormat format
Constructor Detail

Unit

public Unit(String name,
            String plural,
            String abbreviation,
            double value)
Method Detail

toBase

public double toBase(double n)

fromBase

public double fromBase(double n)

parse

public double parse(String s)
             throws NumberFormatException
Throws:
NumberFormatException

format

public String format(double n)

format

public String format(double n,
                     boolean abbrev)

format

public String format(double x,
                     double y,
                     boolean abbrev)

format

public String format(double x,
                     double y)

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object


Copyright © 2011. All Rights Reserved.