Enum Class Area
- All Implemented Interfaces:
Serializable, Comparable<Area>, Constable, Dimension, DimensionWithLinearConversion
@ClassVersion(sourceVersion="$Id: Area.java 1195 2026-04-15 21:33:40Z tquadrat $")
@API(status=STABLE,
since="0.1.0")
public enum Area
extends Enum<Area>
implements DimensionWithLinearConversion
The various instances of area …
- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: Area.java 1195 2026-04-15 21:33:40Z tquadrat $
- Since:
- 0.1.0
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.value.Area"
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAn acre.An Ar (a unit for areas, used in the EU and Switzerland).A hektar (a unit for areas, used in the EU and Switzerland).A %quot;Morgen", an ancient unit for areas that was used in Germany (and is still used sometimes).A square centimeter.A square foot (144 square inch).A square inch.A square kilometer.A square_meter.A square mile (1760 yard).A square millimeter.A square yard (9 square feet). -
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
ConstructorsModifierConstructorDescriptionprivateArea(BigDecimal factor, String unitSymbol) Creates a newAreainstance, with a default precision of zero mantissa digits.privateArea(BigDecimal factor, String unitSymbol, int precision) Creates a newAreainstance. -
Method Summary
Modifier and TypeMethodDescriptionfinal AreabaseUnit()final BigDecimalfactor()static final AreaReturns theAreainstance for the given unit symbol.final intfinal Stringstatic AreaReturns the enum constant of this class with the specified name.static Area[]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
-
SQUARE_MILLIMETER
A square millimeter. -
SQUARE_CENTIMETER
A square centimeter. -
SQUARE_INCH
A square inch. -
SQUARE_FOOT
A square foot (144 square inch). -
SQUARE_YARD
A square yard (9 square feet). -
SQUARE_METER
A square_meter. -
AR
An Ar (a unit for areas, used in the EU and Switzerland). It is 100 square meter. -
MORGEN
A %quot;Morgen", an ancient unit for areas that was used in Germany (and is still used sometimes). It is 25 ar, 2500 square meter or ¼ ha. -
ACRE
-
HEKTAR
A hektar (a unit for areas, used in the EU and Switzerland). It is 100 a or 10000 square meter. -
SQUARE_KILOMETER
A square kilometer. -
SQUARE_MILE
A square mile (1760 yard).
-
-
Field Details
-
m_Factor
The factor. -
m_Precision
The default precision. -
m_UnitSymbol
The unit string.
-
-
Constructor Details
-
Area
Creates a newAreainstance, with a default precision of zero mantissa digits.- Parameters:
factor- The factor.unitSymbol- The unit symbol String.
-
Area
Creates a newAreainstance.- 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 theAreainstance 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
-
