public class Unit extends Object implements Identifiable
| Constructor and Description |
|---|
Unit()
Constructor
|
Unit(UnitType type,
String name)
Constructor
|
Unit(UnitType type,
String name,
double conversionFactor)
Constructor
|
Unit(UnitType type,
String name,
String conversionFactor)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addIdentifier(Identifier identifier)
Add the identifier
|
void |
addIdentifiers(List<Identifier> identifiers)
Add the identifiers
|
boolean |
equals(Object obj) |
boolean |
equalsName(Unit unit)
Determine if the unit names are equal, ignoring case
|
Double |
getConversionFactor()
Get the conversion factor
|
String |
getConversionFactorText()
Get the conversion factor text
|
Identifier |
getIdentifier(int index)
Get the identifier at the index
|
List<Identifier> |
getIdentifiers()
Get the identifiers
|
String |
getName()
Get the name
|
UnitType |
getType()
Get the unit type
|
boolean |
hasConversionFactor()
Has a conversion factor
|
int |
hashCode() |
boolean |
hasIdentifiers()
Has identifiers
|
int |
numIdentifiers()
Number of identifiers
|
void |
setConversionFactor(Double conversionFactor)
Set the conversion factor
|
void |
setConversionFactor(String conversionFactor)
Set the conversion factor
|
void |
setIdentifiers(List<Identifier> identifiers)
Set the identifiers
|
void |
setName(String name)
Set the name
|
void |
setType(UnitType type)
Set the unit type
|
String |
toString() |
public Unit()
public Unit(UnitType type, String name, double conversionFactor)
type - unit typename - nameconversionFactor - conversion factorpublic UnitType getType()
public void setType(UnitType type)
type - unit typepublic String getName()
public void setName(String name)
name - namepublic Double getConversionFactor()
public String getConversionFactorText()
public boolean hasConversionFactor()
public void setConversionFactor(Double conversionFactor)
conversionFactor - conversion factorpublic void setConversionFactor(String conversionFactor)
conversionFactor - conversion factorpublic List<Identifier> getIdentifiers()
getIdentifiers in interface Identifiablepublic boolean hasIdentifiers()
hasIdentifiers in interface Identifiablepublic int numIdentifiers()
numIdentifiers in interface Identifiablepublic Identifier getIdentifier(int index)
getIdentifier in interface Identifiableindex - identifier indexpublic void setIdentifiers(List<Identifier> identifiers)
setIdentifiers in interface Identifiableidentifiers - identifierspublic void addIdentifier(Identifier identifier)
addIdentifier in interface Identifiableidentifier - identifierpublic void addIdentifiers(List<Identifier> identifiers)
addIdentifiers in interface Identifiableidentifiers - identifierspublic boolean equalsName(Unit unit)
unit - unitCopyright © 2021 National Geospatial-Intelligence Agency. All rights reserved.