Package com.darkcollective.relix.symbol
Enum Class ScalarType
- All Implemented Interfaces:
Type,Serializable,Comparable<ScalarType>,Constable
The scalar-value type lattice used for column types, function parameter types,
and function return types.
A ScalarType is the leaf case of the Type hierarchy; the
nested cases are StructType and ArrayType.
ANY is the top type — it is compatible with every other type and
serves as the default when no more specific type has been declared or inferred.
This allows symbols to be registered with minimal ceremony: a relation column
typed ANY will accept values of any kind at analysis time.
Type inference for inline (markdown) relations assigns NUMBER to a
column when every non-header cell in that column parses as a numeric literal;
otherwise STRING is used.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionUnconstrained — compatible with all other types.Boolean data; corresponds to the literalstrueandfalse.A calendar day with no zone, e.g.An exact elapsed span — seconds and nanoseconds (backed byjava.time.Duration).Numeric data; corresponds to integer or decimal numeric literals.Textual data; corresponds to string literals enclosed in double quotes.A wall-clock time of day with no zone, e.g.An absolute point on the timeline, UTC-normalised (backed byjava.time.Instant). -
Method Summary
Modifier and TypeMethodDescriptioncode()Returns the compact type code used in the IR report and in machine-readable (JSON) output:Number,String,Boolean,?=any, and the temporal codesD=date,T=time,TS=timestamp,DUR=duration.display()Returns the lower-cased type name, e.g."number".static ScalarTypefromString(String name) Returns theScalarTypeconstant whose name matchesname, ignoring case.static ScalarTypeReturns the enum constant of this class with the specified name.static ScalarType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ANY
Unconstrained — compatible with all other types. Default when no type annotation is present, and the dynamic document type for schema-on-read sources (a value may be a scalar, struct, or array at runtime). -
STRING
Textual data; corresponds to string literals enclosed in double quotes. -
NUMBER
Numeric data; corresponds to integer or decimal numeric literals. -
BOOLEAN
Boolean data; corresponds to the literalstrueandfalse. -
DATE
A calendar day with no zone, e.g.2026-06-15(backed byjava.time.LocalDate). -
TIME
A wall-clock time of day with no zone, e.g.13:40:00(backed byjava.time.LocalTime). -
TIMESTAMP
An absolute point on the timeline, UTC-normalised (backed byjava.time.Instant). -
DURATION
An exact elapsed span — seconds and nanoseconds (backed byjava.time.Duration).
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
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
-
display
Returns the lower-cased type name, e.g."number". -
code
Returns the compact type code used in the IR report and in machine-readable (JSON) output:Number,String,Boolean,?=any, and the temporal codesD=date,T=time,TS=timestamp,DUR=duration. -
fromString
Returns theScalarTypeconstant whose name matchesname, ignoring case.- Parameters:
name- the type name, e.g."string","NUMBER"- Returns:
- the matching constant
- Throws:
IllegalArgumentException- if no constant matches
-