public class UnitData extends BasicData implements NameableData, RemovableData
getReferenceFactor()
and getReferenceOffset()
correct. This is the formula to use:
1 reference unit * factor + offset = 1 of this unitExamples:
1 meter * 0.001 + 0 = 1 millimeter 1 kelvin * 1 + 273.15 = 1 °Celsius
Unit
,
Developer documentation: AnnotationsModifier and Type | Field and Description |
---|---|
private java.lang.String |
description |
private java.lang.String |
displaySymbol |
static int |
MAX_SYMBOL_LENGTH |
private java.lang.String |
name |
private QuantityData |
quantity |
private double |
referenceFactor |
private double |
referenceOffset |
private java.lang.Integer |
removedBy |
private java.util.Set<UnitSymbolData> |
symbols |
private java.util.Set<AnnotationTypeData> |
usedUnits |
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
Constructor and Description |
---|
UnitData() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDescription()
Get the description for the item.
|
java.lang.String |
getDisplaySymbol()
The symbol to display together with values of this unit.
|
java.lang.String |
getName()
Get the name of the item.
|
QuantityData |
getQuantity()
Get the quantity this unit belongs to.
|
double |
getReferenceFactor()
Factor that controls how this unit relates to the reference
unit of the quantity.
|
double |
getReferenceOffset()
An offset that controls how this unit relates to the reference
unit of the quantity.
|
java.lang.Integer |
getRemovedBy()
Get the ID of the user that removed this item.
|
java.util.Set<UnitSymbolData> |
getSymbols()
This is the inverse end.
|
(package private) java.util.Set<AnnotationTypeData> |
getUsedUnits()
This is the inverse end.
|
void |
setDescription(java.lang.String description)
Set the description for the item.
|
void |
setDisplaySymbol(java.lang.String displaySymbol) |
void |
setName(java.lang.String name)
Set the name of the item.
|
void |
setQuantity(QuantityData quantity) |
void |
setReferenceFactor(double referenceFactor) |
void |
setReferenceOffset(double referenceOffset) |
void |
setRemovedBy(java.lang.Integer removedBy)
Set the ID of the user that removed this item or null
to restore the item.
|
(package private) void |
setSymbols(java.util.Set<UnitSymbolData> symbols) |
(package private) void |
setUsedUnits(java.util.Set<AnnotationTypeData> usedUnits) |
equals, getId, getVersion, hashCode, setId, setVersion, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getVersion
private java.lang.String name
private java.lang.String description
private java.lang.Integer removedBy
private QuantityData quantity
public static final int MAX_SYMBOL_LENGTH
private java.lang.String displaySymbol
private double referenceFactor
private double referenceOffset
private java.util.Set<UnitSymbolData> symbols
private java.util.Set<AnnotationTypeData> usedUnits
public java.lang.String getName()
NameableData
getName
in interface NameableData
String
with the name of the itempublic void setName(java.lang.String name)
NameableData
MAX_NAME_LENGTH
constant.setName
in interface NameableData
name
- The new name for the itempublic java.lang.String getDescription()
NameableData
getDescription
in interface NameableData
String
with a description of the itempublic void setDescription(java.lang.String description)
NameableData
MAX_DESCRIPTION_LENGTH
constant.setDescription
in interface NameableData
description
- The new description for the itempublic java.lang.Integer getRemovedBy()
RemovableData
getRemovedBy
in interface RemovableData
public void setRemovedBy(java.lang.Integer removedBy)
RemovableData
setRemovedBy
in interface RemovableData
public QuantityData getQuantity()
public void setQuantity(QuantityData quantity)
public java.lang.String getDisplaySymbol()
public void setDisplaySymbol(java.lang.String displaySymbol)
public double getReferenceFactor()
getReferenceOffset()
public void setReferenceFactor(double referenceFactor)
public double getReferenceOffset()
getReferenceFactor()
public void setReferenceOffset(double referenceOffset)
public java.util.Set<UnitSymbolData> getSymbols()
UnitSymbolData.getUnit()
void setSymbols(java.util.Set<UnitSymbolData> symbols)
java.util.Set<AnnotationTypeData> getUsedUnits()
AnnotationTypeData.getUsableUnits()
void setUsedUnits(java.util.Set<AnnotationTypeData> usedUnits)