java.lang.Object
org.tquadrat.foundation.value.api.ValueBase<Power,PowerValue>
org.tquadrat.foundation.value.PowerValue
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<DimensionedValue<Power>>
,Formattable
,DimensionedValue<Power>
@ClassVersion(sourceVersion="$Id: PowerValue.java 1073 2023-10-01 11:08:51Z tquadrat $")
@API(status=STABLE,
since="0.3.0")
public final class PowerValue
extends ValueBase<Power,PowerValue>
A value class for Powers.
- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: PowerValue.java 1073 2023-10-01 11:08:51Z tquadrat $
- Since:
- 0.3.0
- See Also:
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.value.PowerValue"
-
Field Summary
Fields inherited from class org.tquadrat.foundation.value.api.ValueBase
DEFAULT_VALIDATOR
Fields inherited from interface org.tquadrat.foundation.value.api.DimensionedValue
MATH_CONTEXT
-
Constructor Summary
ConstructorsConstructorDescriptionPowerValue
(Power dimension, String value) Creates a newPowerValue
instance.PowerValue
(Power dimension, BigDecimal value) Creates a newPowerValue
instance.PowerValue
(Power dimension, N value) Creates a newPowerValue
instance. -
Method Summary
Methods inherited from class org.tquadrat.foundation.value.api.ValueBase
baseValue, copy, copy, equals, getUnit, hashCode, setUnit, toString
-
Constructor Details
-
PowerValue
Creates a newPowerValue
instance.- Parameters:
dimension
- The dimension.value
- The value.
-
PowerValue
Creates a newPowerValue
instance.- Parameters:
dimension
- The dimension.value
- The value; it must be possible to parse the given String into aBigDecimal
.- Throws:
NumberFormatException
- The provided value cannot be converted into aBigDecimal
.
-
PowerValue
Creates a newPowerValue
instance.- Type Parameters:
N
- The type ofvalue
.- Parameters:
dimension
- The dimension.value
- The value.
-
-
Method Details
-
clone
Creates a new copy of this value.- Specified by:
clone
in interfaceDimensionedValue<Power>
- Overrides:
clone
in classValueBase<Power,
PowerValue> - Returns:
- The copy.
-