Enum Class Power
- All Implemented Interfaces:
Serializable, Comparable<Power>, Constable, Dimension, DimensionWithLinearConversion
@ClassVersion(sourceVersion="$Id: Power.java 1195 2026-04-15 21:33:40Z tquadrat $")
@API(status=STABLE,
since="0.3.0")
public enum Power
extends Enum<Power>
implements DimensionWithLinearConversion
The various instances of power …
- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: Power.java 1195 2026-04-15 21:33:40Z tquadrat $
- Since:
- 0.3.0
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.value.Power"
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAn erg per second.A giga Watt.A 'horsepower'.A kilo Watt.A kilo Watt.A micro Watt.A milli Watt.A Tera Watt.A Watt. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BigDecimalThe factor.private final intThe default precision.private final StringThe unit string.Fields inherited from interface DimensionWithLinearConversion
MSG_UnknownUnit -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePower(BigDecimal factor, String unitSymbol) Creates a newPowerinstance, with a default precision of zero mantissa digits.privatePower(BigDecimal factor, String unitSymbol, int precision) Creates a newPowerinstance. -
Method Summary
Modifier and TypeMethodDescriptionfinal PowerbaseUnit()final BigDecimalfactor()static final PowerReturns thePowerinstance for the given unit symbol.final intfinal Stringstatic PowerReturns the enum constant of this class with the specified name.static Power[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface Dimension
equals, name, toString, unitSymbolForPrintingMethods inherited from interface DimensionWithLinearConversion
fromBase, toBase
-
Enum Constant Details
-
ERG_PER_SECOND
An erg per second.
This is the unit of power in the CGS unit system.
-
MICROWATT
-
MILLIWATT
-
WATT
-
HORSE_POWER
A 'horsepower'. -
KILOWATT
-
MEGAWATT
-
GIGAWATT
-
TERAWATT
-
-
Field Details
-
m_Factor
The factor. -
m_Precision
The default precision. -
m_UnitSymbol
The unit string.
-
-
Constructor Details
-
Power
Creates a newPowerinstance, with a default precision of zero mantissa digits.- Parameters:
factor- The factor.unitSymbol- The unit symbol String.
-
Power
Creates a newPowerinstance.- Parameters:
factor- The factor.unitSymbol- The unit symbol String.precision- The default precision.
-
-
Method Details
-
values
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
baseUnit
-
factor
- Specified by:
factorin interfaceDimensionWithLinearConversion
-
forUnit
Returns thePowerinstance for the given unit symbol.- Parameters:
unitSymbol- The unit symbol.- Returns:
- The respective instance.
- Throws:
IllegalArgumentException- The given unit is unknown.
-
getPrecision
- Specified by:
getPrecisionin interfaceDimension
-
unitSymbol
- Specified by:
unitSymbolin interfaceDimension
-
