Package com.io7m.cardant.model
Record Class CATypeScalarType.Real
java.lang.Object
java.lang.Record
com.io7m.cardant.model.CATypeScalarType.Real
- Record Components:
name- The type namedescription- A humanly-readable description of the typerangeLower- The lower bound (inclusive)rangeUpper- The upper bound (inclusive)
- All Implemented Interfaces:
CATypeScalarType
- Enclosing interface:
CATypeScalarType
public static record CATypeScalarType.Real(com.io7m.lanark.core.RDottedName name, String description, double rangeLower, double rangeUpper)
extends Record
implements CATypeScalarType
A real type.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.io7m.cardant.model.CATypeScalarType
CATypeScalarType.Integral, CATypeScalarType.Kind, CATypeScalarType.Monetary, CATypeScalarType.Real, CATypeScalarType.Text, CATypeScalarType.Time -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisValid(double value) kind()com.io7m.lanark.core.RDottedNamename()Returns the value of thenamerecord component.doubleReturns the value of therangeLowerrecord component.doubleReturns the value of therangeUpperrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Real
public Real(com.io7m.lanark.core.RDottedName name, String description, double rangeLower, double rangeUpper) A real type.
-
-
Method Details
-
showConstraint
- Specified by:
showConstraintin interfaceCATypeScalarType- Returns:
- A humanly-readable description of this type's value constraints
-
kind
- Specified by:
kindin interfaceCATypeScalarType- Returns:
- The internal type kind
-
isValid
public boolean isValid(double value) - Parameters:
value- The value- Returns:
trueif the given value is in the range for this type
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
public com.io7m.lanark.core.RDottedName name()Returns the value of thenamerecord component.- Specified by:
namein interfaceCATypeScalarType- Returns:
- the value of the
namerecord component
-
description
Returns the value of thedescriptionrecord component.- Specified by:
descriptionin interfaceCATypeScalarType- Returns:
- the value of the
descriptionrecord component
-
rangeLower
public double rangeLower()Returns the value of therangeLowerrecord component.- Returns:
- the value of the
rangeLowerrecord component
-
rangeUpper
public double rangeUpper()Returns the value of therangeUpperrecord component.- Returns:
- the value of the
rangeUpperrecord component
-