public class TimestampUnit extends TypedUnit<TimestampUnit>
TypedUnit.UnitSelector<U extends TypedUnit<U>>
EMPTY_STRING_ARRAY
Modifier and Type | Method and Description |
---|---|
protected ITypedQuantity<TimestampUnit> |
add(long numericalAugend,
LinearUnit addendUnit,
long numericalAddend) |
boolean |
equals(Object other) |
protected ITypedQuantity<TimestampUnit> |
floorQuantize(double numericalValue,
ITypedQuantity<LinearUnit> quanta) |
protected ITypedQuantity<TimestampUnit> |
floorQuantize(long numericalValue,
ITypedQuantity<LinearUnit> quanta) |
String[] |
getAltLocalizedNames()
Get alternate names for content assist matching.
|
String |
getAppendableSuffix(boolean useBreakingSpace)
Convenience method for (localized) formatters, to prepend a space to
IUnit.getLocalizedSymbol() , if needed. |
KindOfQuantity<TimestampUnit> |
getContentType()
Get the kind of quantity of this unit.
|
LinearUnit |
getDeltaUnit()
Get the unit that the difference between two quantities in this unit will have.
|
String |
getIdentifier()
Persistable identifier, not to show interactively.
|
String |
getLocalizedDescription()
In the real world, units are sometimes used ambiguously (like MB).
|
String |
getLocalizedSymbol()
Symbols for units are most often not locale dependent, but there are exceptions (like in
French).
|
protected TimestampUnit |
getScaledUnit(LinearUnit deltaUnit)
Return a unit with the same origin (if absolute) as this unit, but with the given
deltaUnit as its delta unit. |
protected Class<TimestampUnit> |
getUnitClass()
|
int |
hashCode() |
boolean |
isLinear()
If this unit is linear.
|
protected String |
localizedFormatFor(Number numericalValue,
boolean useBreakingSpace,
boolean allowCustomUnit) |
protected String |
persistableStringFor(Number numericalValue) |
ITypedQuantity<TimestampUnit> |
quantity(double numericalValue)
Create a quantity expressed in this unit and with a numerical quantity value equal to
numericalValue . |
ITypedQuantity<TimestampUnit> |
quantity(long numericalValue)
Create a quantity expressed in this unit and with a numerical quantity value equal to
numericalValue . |
ITypedQuantity<TimestampUnit> |
quantity(Number numericalValue)
Create a quantity expressed in this unit and with a numerical quantity value equal to
numericalValue . |
protected ITypedQuantity<LinearUnit> |
subtractSame(long numericalMinuend,
TimestampUnit subtrahendUnit,
long numericalSubtrahend) |
String |
toString() |
IScalarAffineTransform |
valueTransformTo(TimestampUnit targetUnit)
Get a transform for transforming numerical quantity values expressed in this unit to
numerical quantity values expressed in
targetUnit . |
addPossiblyIntegral, valueTransformTo
protected final Class<TimestampUnit> getUnitClass()
TypedUnit
Class
object of the actual TypedUnit
subclass U
. This
method is intended to simplify generic code, written in TypedUnit
, to go from loosely
typed arguments into stricter parameterized arguments.getUnitClass
in class TypedUnit<TimestampUnit>
public LinearUnit getDeltaUnit()
IUnit
protected TimestampUnit getScaledUnit(LinearUnit deltaUnit)
TypedUnit
deltaUnit
as its delta unit. Linear units
will return
deltaUnit
.getScaledUnit
in class TypedUnit<TimestampUnit>
public KindOfQuantity<TimestampUnit> getContentType()
IUnit
getContentType
in interface IUnit
getContentType
in class TypedUnit<TimestampUnit>
public ITypedQuantity<TimestampUnit> quantity(Number numericalValue)
IUnit
numericalValue
.quantity
in interface IUnit
quantity
in class TypedUnit<TimestampUnit>
public ITypedQuantity<TimestampUnit> quantity(long numericalValue)
IUnit
numericalValue
.quantity
in interface IUnit
quantity
in class TypedUnit<TimestampUnit>
public ITypedQuantity<TimestampUnit> quantity(double numericalValue)
IUnit
numericalValue
.quantity
in interface IUnit
quantity
in class TypedUnit<TimestampUnit>
public IScalarAffineTransform valueTransformTo(TimestampUnit targetUnit)
TypedUnit
targetUnit
. This method is typically only used
internally by the quantity implementations. Note that this method differs from
TypedUnit.valueTransformTo(IUnit)
only by stricter typing.valueTransformTo
in class TypedUnit<TimestampUnit>
public boolean isLinear()
IUnit
true
if and only if the unit is linearprotected ITypedQuantity<TimestampUnit> add(long numericalAugend, LinearUnit addendUnit, long numericalAddend)
add
in class TypedUnit<TimestampUnit>
protected ITypedQuantity<LinearUnit> subtractSame(long numericalMinuend, TimestampUnit subtrahendUnit, long numericalSubtrahend)
subtractSame
in class TypedUnit<TimestampUnit>
protected ITypedQuantity<TimestampUnit> floorQuantize(long numericalValue, ITypedQuantity<LinearUnit> quanta)
floorQuantize
in class TypedUnit<TimestampUnit>
protected ITypedQuantity<TimestampUnit> floorQuantize(double numericalValue, ITypedQuantity<LinearUnit> quanta)
floorQuantize
in class TypedUnit<TimestampUnit>
public String getIdentifier()
IUnit
public String getLocalizedSymbol()
IUnit
While symbols normally don't contain any white space, spacing occur in circumstances like
custom units. In this case, it is important that they are non-breaking spaces
(
).
public String getAppendableSuffix(boolean useBreakingSpace)
IUnit
IUnit.getLocalizedSymbol()
, if needed.useBreakingSpace
- to use breaking space instead of the default, non-breaking space (only for edit)public String getLocalizedDescription()
IUnit
public String[] getAltLocalizedNames()
IUnit
null
.protected String localizedFormatFor(Number numericalValue, boolean useBreakingSpace, boolean allowCustomUnit)
localizedFormatFor
in class TypedUnit<TimestampUnit>
protected String persistableStringFor(Number numericalValue)
persistableStringFor
in class TypedUnit<TimestampUnit>
Copyright © 2020. All rights reserved.