Package org.goplanit.utils.unit
Class SimpleUnit
- java.lang.Object
-
- org.goplanit.utils.unit.SimpleUnit
-
- All Implemented Interfaces:
Unit
- Direct Known Subclasses:
DistanceUnit
,NoneUnit
,SrsUnit
,TimeUnit
,VehiclesUnit
public abstract class SimpleUnit extends Object implements Unit
Simple unit that comprises a single unit- Author:
- markr
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SimpleUnit(UnitType unitType)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canConvertTo(Unit other)
Verify if unit can be converted to the desired unitboolean
equals(Object o)
boolean
isCombinedUnit()
Is the unit a single or combined unitString
toString()
-
-
-
Field Detail
-
unitType
protected UnitType unitType
type of the unit
-
-
Constructor Detail
-
SimpleUnit
protected SimpleUnit(UnitType unitType)
Constructor- Parameters:
unitType
- to use
-
-
Method Detail
-
isCombinedUnit
public boolean isCombinedUnit()
Is the unit a single or combined unit- Specified by:
isCombinedUnit
in interfaceUnit
- Returns:
- false when single, true when combined
-
canConvertTo
public boolean canConvertTo(Unit other)
Verify if unit can be converted to the desired unit- Specified by:
canConvertTo
in interfaceUnit
- Parameters:
other
- to unit- Returns:
- true when compatible, false otherwise
-
-