|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.data.BasicData net.sf.basedb.core.data.UnitData
public class UnitData
This class holds information units. It is important to
get the 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
Field Summary | |
---|---|
private String |
description
|
private String |
displaySymbol
|
static int |
MAX_SYMBOL_LENGTH
|
private String |
name
|
private QuantityData |
quantity
|
private double |
referenceFactor
|
private double |
referenceOffset
|
private boolean |
removed
|
private Set<UnitSymbolData> |
symbols
|
private Set<AnnotationTypeData> |
usedUnits
|
Fields inherited from interface net.sf.basedb.core.data.NameableData |
---|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH |
Constructor Summary | |
---|---|
UnitData()
|
Method Summary | |
---|---|
String |
getDescription()
Get the description for the item. |
String |
getDisplaySymbol()
The symbol to display together with values of this unit. |
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. |
Set<UnitSymbolData> |
getSymbols()
This is the inverse end. |
(package private) Set<AnnotationTypeData> |
getUsedUnits()
This is the inverse end. |
boolean |
isRemoved()
Check if the removed flag is set for this item. |
void |
setDescription(String description)
Set the description for the item. |
void |
setDisplaySymbol(String displaySymbol)
|
void |
setName(String name)
Set the name of the item. |
void |
setQuantity(QuantityData quantity)
|
void |
setReferenceFactor(double referenceFactor)
|
void |
setReferenceOffset(double referenceOffset)
|
void |
setRemoved(boolean removed)
Set the removed flag for this item. |
(package private) void |
setSymbols(Set<UnitSymbolData> symbols)
|
(package private) void |
setUsedUnits(Set<AnnotationTypeData> usedUnits)
|
Methods inherited from class net.sf.basedb.core.data.BasicData |
---|
equals, getId, getVersion, hashCode, setId, setVersion, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sf.basedb.core.data.IdentifiableData |
---|
getId, getVersion |
Field Detail |
---|
private String name
private String description
private boolean removed
private QuantityData quantity
public static final int MAX_SYMBOL_LENGTH
private String displaySymbol
private double referenceFactor
private double referenceOffset
private Set<UnitSymbolData> symbols
private Set<AnnotationTypeData> usedUnits
Constructor Detail |
---|
public UnitData()
Method Detail |
---|
public String getName()
NameableData
getName
in interface NameableData
String
with the name of the itempublic void setName(String name)
NameableData
MAX_NAME_LENGTH
constant.
setName
in interface NameableData
name
- The new name for the itempublic String getDescription()
NameableData
getDescription
in interface NameableData
String
with a description of the itempublic void setDescription(String description)
NameableData
MAX_DESCRIPTION_LENGTH
constant.
setDescription
in interface NameableData
description
- The new description for the itempublic boolean isRemoved()
RemovableData
isRemoved
in interface RemovableData
public void setRemoved(boolean removed)
RemovableData
setRemoved
in interface RemovableData
removed
- TRUE if the item should be flagged as removed,
FALSE otherwisepublic QuantityData getQuantity()
public void setQuantity(QuantityData quantity)
public String getDisplaySymbol()
public void setDisplaySymbol(String displaySymbol)
public double getReferenceFactor()
getReferenceOffset()
public void setReferenceFactor(double referenceFactor)
public double getReferenceOffset()
getReferenceFactor()
public void setReferenceOffset(double referenceOffset)
public Set<UnitSymbolData> getSymbols()
UnitSymbolData.getUnit()
void setSymbols(Set<UnitSymbolData> symbols)
Set<AnnotationTypeData> getUsedUnits()
AnnotationTypeData.getUsableUnits()
void setUsedUnits(Set<AnnotationTypeData> usedUnits)
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |