chrriis.uihierarchy.unit
Class Millimeter

java.lang.Object
  extended bychrriis.uihierarchy.unit.Millimeter

public class Millimeter
extends Object

A handler to manipulate a default unit representing a millimeter.

Version:
1.0 2005.02.01
Author:
Christopher Deckers (chrriis@brainlex.com)

Nested Class Summary
static class Millimeter.MillimeterUnit
          A unit representing a millimeter.
 
Method Summary
static double doubleValue(String unitValue)
          Parse a value along with its unit from a String representation, and convert it to this unit.
static double doubleValue(String unitName, double value)
          Get the double value resulting from the conversion of the value from the specified unit.
static double doubleValue(Unit unit, double value)
          Get the double value resulting from the conversion of the value from the specified unit.
static Millimeter.MillimeterUnit getUnit()
          Get the default unit.
static int intValue(String unitValue)
          Parse a value along with its unit from a String representation, and convert it to this unit.
static Millimeter.MillimeterUnit newInstance()
          Create a new instance of this unit.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getUnit

public static Millimeter.MillimeterUnit getUnit()
Get the default unit.

Returns:
The default unit.

newInstance

public static Millimeter.MillimeterUnit newInstance()
Create a new instance of this unit.

Returns:
The newly created instance.

doubleValue

public static double doubleValue(String unitName,
                                 double value)
Get the double value resulting from the conversion of the value from the specified unit.

Parameters:
unitName - A name identifying the unit from which to convert.
value - The value to convert.
Returns:
The result of the conversion.

doubleValue

public static double doubleValue(Unit unit,
                                 double value)
Get the double value resulting from the conversion of the value from the specified unit.

Parameters:
unit - The unit from which to convert.
value - The value to convert.
Returns:
The result of the conversion.

intValue

public static int intValue(String unitValue)
Parse a value along with its unit from a String representation, and convert it to this unit.

Parameters:
unitValue - The value with a unit in its String representation. If the unit is not specified, then assume it is Pixel.
Returns:
The int value resulting from the conversion.

doubleValue

public static double doubleValue(String unitValue)
Parse a value along with its unit from a String representation, and convert it to this unit.

Parameters:
unitValue - The value with a unit in its String representation. If the unit is not specified, then assume it is Pixel.
Returns:
The double value resulting from the conversion.