Package mgui.util
Class Unit
java.lang.Object
mgui.util.Unit
- All Implemented Interfaces:
java.lang.Comparable<Unit>
- Direct Known Subclasses:
ScaledUnit
public abstract class Unit extends java.lang.Object implements java.lang.Comparable<Unit>
Specifies an abstract unit, with a conversion factor to some base unit.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Constructor Summary
Constructors Constructor Description Unit()
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
Unit
public Unit()
-
-
Method Details
-
getName
public abstract java.lang.String getName() -
getShortName
public abstract java.lang.String getShortName() -
convert
Convertsvalue
, specified withunit
, to its equivalent in thisUnit
.- Parameters:
unit
- the unit in whichvalue
is currently specifiedvalue
- the value to convert- Returns:
- the equivalent of
value
in this unit - Throws:
UnitConversionException
-
compareTo
- Specified by:
compareTo
in interfacejava.lang.Comparable<Unit>
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-