Enum Class Force
- All Implemented Interfaces:
Serializable, Comparable<Force>, Constable, Dimension, DimensionWithLinearConversion
@ClassVersion(sourceVersion="$Id: Force.java 1195 2026-04-15 21:33:40Z tquadrat $")
@API(status=STABLE,
since="0.3.0")
public enum Force
extends Enum<Force>
implements DimensionWithLinearConversion
The various instances of force …
- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: Force.java 1195 2026-04-15 21:33:40Z tquadrat $
- Since:
- 0.3.0
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.value.Force"
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionA dyn.A kilo Newton.A kilo pondA Mega pondA micro Newton.A Newton.A pond -
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
ConstructorsModifierConstructorDescriptionprivateForce(BigDecimal factor, String unitSymbol) Creates a newForceinstance, with a default precision of zero mantissa digits.privateForce(BigDecimal factor, String unitSymbol, int precision) Creates a newForceinstance. -
Method Summary
Modifier and TypeMethodDescriptionfinal ForcebaseUnit()final BigDecimalfactor()static final ForceReturns theForceinstance for the given unit symbol.final intfinal Stringstatic ForceReturns the enum constant of this class with the specified name.static Force[]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
-
MICRONEWTON
A micro Newton. -
DYN
-
POND
-
NEWTON
-
KILOPOND
-
KILONEWTON
A kilo Newton. -
MEGAPOND
-
-
Field Details
-
m_Factor
The factor. -
m_Precision
The default precision. -
m_UnitSymbol
The unit string.
-
-
Constructor Details
-
Force
Creates a newForceinstance, with a default precision of zero mantissa digits.- Parameters:
factor- The factor.unitSymbol- The unit symbol String.
-
Force
Creates a newForceinstance.- 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 theForceinstance 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
-
