Package mil.nga.crs.common
Class Unit
- java.lang.Object
-
- mil.nga.crs.common.Unit
-
- All Implemented Interfaces:
Identifiable
public class Unit extends Object implements Identifiable
Unit- Author:
- osbornb
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addIdentifier(Identifier identifier)
Add the identifiervoid
addIdentifiers(List<Identifier> identifiers)
Add the identifiersboolean
equals(Object obj)
boolean
equalsName(Unit unit)
Determine if the unit names are equal, ignoring caseDouble
getConversionFactor()
Get the conversion factorString
getConversionFactorText()
Get the conversion factor textIdentifier
getIdentifier(int index)
Get the identifier at the indexList<Identifier>
getIdentifiers()
Get the identifiersString
getName()
Get the nameUnitType
getType()
Get the unit typeboolean
hasConversionFactor()
Has a conversion factorint
hashCode()
boolean
hasIdentifiers()
Has identifiersint
numIdentifiers()
Number of identifiersvoid
setConversionFactor(Double conversionFactor)
Set the conversion factorvoid
setConversionFactor(String conversionFactor)
Set the conversion factorvoid
setIdentifiers(List<Identifier> identifiers)
Set the identifiersvoid
setName(String name)
Set the namevoid
setType(UnitType type)
Set the unit typeString
toString()
-
-
-
Method Detail
-
getType
public UnitType getType()
Get the unit type- Returns:
- unit type
-
setType
public void setType(UnitType type)
Set the unit type- Parameters:
type
- unit type
-
getName
public String getName()
Get the name- Returns:
- name
-
setName
public void setName(String name)
Set the name- Parameters:
name
- name
-
getConversionFactor
public Double getConversionFactor()
Get the conversion factor- Returns:
- conversion factor
-
getConversionFactorText
public String getConversionFactorText()
Get the conversion factor text- Returns:
- conversion factor text
- Since:
- 1.1.0
-
hasConversionFactor
public boolean hasConversionFactor()
Has a conversion factor- Returns:
- true if has conversion factor
-
setConversionFactor
public void setConversionFactor(Double conversionFactor)
Set the conversion factor- Parameters:
conversionFactor
- conversion factor
-
setConversionFactor
public void setConversionFactor(String conversionFactor)
Set the conversion factor- Parameters:
conversionFactor
- conversion factor- Since:
- 1.1.0
-
getIdentifiers
public List<Identifier> getIdentifiers()
Get the identifiers- Specified by:
getIdentifiers
in interfaceIdentifiable
- Returns:
- identifiers
-
hasIdentifiers
public boolean hasIdentifiers()
Has identifiers- Specified by:
hasIdentifiers
in interfaceIdentifiable
- Returns:
- true if has identifiers
-
numIdentifiers
public int numIdentifiers()
Number of identifiers- Specified by:
numIdentifiers
in interfaceIdentifiable
- Returns:
- identifiers count
-
getIdentifier
public Identifier getIdentifier(int index)
Get the identifier at the index- Specified by:
getIdentifier
in interfaceIdentifiable
- Parameters:
index
- identifier index- Returns:
- identifier
-
setIdentifiers
public void setIdentifiers(List<Identifier> identifiers)
Set the identifiers- Specified by:
setIdentifiers
in interfaceIdentifiable
- Parameters:
identifiers
- identifiers
-
addIdentifier
public void addIdentifier(Identifier identifier)
Add the identifier- Specified by:
addIdentifier
in interfaceIdentifiable
- Parameters:
identifier
- identifier
-
addIdentifiers
public void addIdentifiers(List<Identifier> identifiers)
Add the identifiers- Specified by:
addIdentifiers
in interfaceIdentifiable
- Parameters:
identifiers
- identifiers
-
equalsName
public boolean equalsName(Unit unit)
Determine if the unit names are equal, ignoring case- Parameters:
unit
- unit- Returns:
- true if equal names
- Since:
- 1.1.0
-
-