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 whichvalueis currently specifiedvalue- the value to convert- Returns:
- the equivalent of
valuein this unit - Throws:
UnitConversionException
-
compareTo
- Specified by:
compareToin interfacejava.lang.Comparable<Unit>
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-