- All Implemented Interfaces:
Serializable,Cloneable,Comparable<DimensionedValue<Area>>,Formattable,DimensionedValue<Area>
@ClassVersion(sourceVersion="$Id: AreaValue.java 1073 2023-10-01 11:08:51Z tquadrat $")
@API(status=STABLE,
since="0.1.0")
public final class AreaValue
extends ValueBase<Area,AreaValue>
A value class for areas.
- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: AreaValue.java 1073 2023-10-01 11:08:51Z tquadrat $
- Since:
- 0.1.0
- See Also:
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.value.AreaValue"
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final BiPredicate<Area, BigDecimal> The validator for areas.Fields inherited from class org.tquadrat.foundation.value.api.ValueBase
DEFAULT_VALIDATORFields inherited from interface org.tquadrat.foundation.value.api.DimensionedValue
MATH_CONTEXT -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newAreaValueinstance.AreaValue(Area dimension, BigDecimal value) Creates a newAreaValueinstance.Creates a newAreaValueinstance.AreaValue(Area dimension, LengthValue length, LengthValue width) Creates a newAreaValueinstance. -
Method Summary
Methods inherited from class org.tquadrat.foundation.value.api.ValueBase
baseValue, copy, copy, equals, getUnit, hashCode, setUnit, toString
-
Field Details
-
AREA_VALIDATOR
The validator for areas.
An area may not be less than 0.
-
-
Constructor Details
-
AreaValue
Creates a newAreaValueinstance.- Parameters:
dimension- The dimension.value- The value.
-
AreaValue
Creates a newAreaValueinstance.- 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.
-
AreaValue
Creates a newAreaValueinstance.- Type Parameters:
N- The type ofvalue.- Parameters:
dimension- The dimension.value- The value.
-
AreaValue
Creates a new
AreaValueinstance. An area can be determined by multiplication of length and width.- Parameters:
dimension- The dimension.length- The length.width- The width.
-
-
Method Details
