public final class SIContent extends FloatingPointContent
Instances of this class implements SI base units and derived units with special names. Using these instances avoids the specification of a large number of content definitions in the metadata.
Each point using this content will have a 'Unit' param holding an optional SI prefix and a mandatory SI symbol.
This implementation keeps a cache of the generated instances keyed by the value multiplier.
Proxied.Abstract
Modifier and Type | Field and Description |
---|---|
static String |
UNIT_PARAM
Param holding the abbreviation of a base or derived unit, including an
optional prefix.
|
Constructor and Description |
---|
SIContent() |
Modifier and Type | Method and Description |
---|---|
Serializable |
decode(PointValue pointValue)
Decodes the value of a point value.
|
Double |
denormalize(NormalizedValue normalizedValue)
Denormalizes the value of a point value.
|
Content |
getInstance(Point point)
Gets an appropriate instance of this content for the point.
|
Serializable |
normalize(PointValue pointValue)
Normalizes the value of a point value.
|
boolean |
setUp(Metadata metadata,
ProxyEntity proxyEntity)
Sets up the instance for action.
|
void |
tearDown()
Tears down what has been set up.
|
encode, warnBadValue
getMetadata, getName, getParams, getProxyEntity, getThisLogger
public static final String UNIT_PARAM
public Serializable decode(PointValue pointValue)
Converts from an external representation to an internal representation.
decode
in interface Content
decode
in class AbstractContent
pointValue
- The point value associated with the value to decode.public Double denormalize(NormalizedValue normalizedValue)
Converts from an internal unit to an external unit.
denormalize
in interface Content
denormalize
in class AbstractContent
normalizedValue
- The point value associated with the value to be
denormalized.public Content getInstance(Point point)
getInstance
in interface Content
getInstance
in class AbstractContent
point
- The point.public Serializable normalize(PointValue pointValue)
Converts from an external unit to an internal unit.
normalize
in interface Content
normalize
in class AbstractContent
pointValue
- The point value associated with the value to be
normalized.public boolean setUp(Metadata metadata, ProxyEntity proxyEntity)
setUp
in interface Proxied
setUp
in class Proxied.Abstract
metadata
- The metadata available to the current process.proxyEntity
- The proxy entity refering to the proxied.public void tearDown()
tearDown
in interface Proxied
tearDown
in class Proxied.Abstract
Copyright © 2003-2019 Serge Brisson. All Rights Reserved.