chrriis.uihierarchy.unit
Class Unit

java.lang.Object
  extended bychrriis.uihierarchy.unit.Unit
Direct Known Subclasses:
DluX.DluXUnit, DluY.DluYUnit, Pixel.PixelUnit, chrriis.uihierarchy.unit.ScreenUnit

public abstract class Unit
extends Object

A unit, used to perform conversions, mainly from and to pixels.

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

Method Summary
abstract  String[] getNames()
          Get the names representing the unit.
static Unit getUnit(String unitName)
          Get a unit registered with the given name.
static void registerUnit(Unit unit)
          Register a unit, using the names it defines.
static void registerUnit(Unit unit, String[] names)
          Register a unit, with some names that define it.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getNames

public abstract String[] getNames()
Get the names representing the unit.

Returns:
An array containing the names.

registerUnit

public static void registerUnit(Unit unit)
Register a unit, using the names it defines.

Parameters:
unit - The unit to register.

registerUnit

public static void registerUnit(Unit unit,
                                String[] names)
Register a unit, with some names that define it.

Parameters:
unit - The unit to register.
names - The names that identify the unit.

getUnit

public static Unit getUnit(String unitName)
Get a unit registered with the given name.

Parameters:
unitName - A name identifying the unit to get.
Returns:
The unit corresponding to that name, or null if could not be found.