public class UnitLibrary
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static Unit |
Identity
The Identity Unit, i.e. 1.0*<0, 0, ..., 0>
|
Constructor and Description |
---|
UnitLibrary() |
Modifier and Type | Method and Description |
---|---|
static void |
addToLibrary(Unit unit)
Add a unit to the Library.
|
static Unit |
getBaseUnit(int catNum)
Find the Unit in the library that is basic (scale equal to 1),
singular (all but one dimensions equal to 0).
|
static Unit |
getClosestUnit(Unit unit)
Search Library to find Unit that has the same type and is the
closest to a unit in terms of the scalars.
|
static java.util.Vector |
getLibrary()
Return the Library.
|
static int |
getNumCategories()
Return the number of categories.
|
static UParser |
getParser()
Return the Parser.
|
static Unit |
getUnit(Unit unit)
Search Library for Unit equal to a particular unit.
|
static Unit |
getUnitByName(java.lang.String name)
Search the Library for a unit with a particular name.
|
static java.util.Vector |
getUnitsByType(Unit unit)
Search Library for all Units with type equal to this one.
|
public static final Unit Identity
public static void addToLibrary(Unit unit)
unit
- Unit to add to the library.public static Unit getBaseUnit(int catNum)
catNum
- The category number.public static Unit getClosestUnit(Unit unit)
unit
- The unit for which to search.public static java.util.Vector getLibrary()
public static int getNumCategories()
public static UParser getParser()
public static Unit getUnit(Unit unit)
unit
- The unit to search for.public static Unit getUnitByName(java.lang.String name)
name
- The name of the desired unit.public static java.util.Vector getUnitsByType(Unit unit)
unit
- The unit to search for.