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 protectedSimpleUnit(UnitType unitType)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanConvertTo(Unit other)Verify if unit can be converted to the desired unitbooleanequals(Object o)booleanisCombinedUnit()Is the unit a single or combined unitStringtoString()
-
-
-
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:
isCombinedUnitin 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:
canConvertToin interfaceUnit- Parameters:
other- to unit- Returns:
- true when compatible, false otherwise
-
-