Package io.trino.spi.type
Class AbstractType
java.lang.Object
io.trino.spi.type.AbstractType
- All Implemented Interfaces:
Type
- Direct Known Subclasses:
AbstractIntType,AbstractLongType,AbstractVariableWidthType,ArrayType,BooleanType,DecimalType,DoubleType,MapType,RowType,SmallintType,TimestampType,TimestampWithTimeZoneType,TimeWithTimeZoneType,TinyintType,UuidType
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.trino.spi.type.Type
Type.Range -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractType(TypeSignature signature, Class<?> javaType, Class<? extends ValueBlock> valueBlockType) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleangetBoolean(Block block, int position) Gets the value at theblockpositionas a boolean.Returns the name of this type that should be displayed to end-users.doubleGets the value at theblockpositionas a double.final Class<?>Gets the Java class type used to represent this value on the stack during expression execution.longGets the value at theblockpositionas a long.Gets the value at theblockpositionas an Object.io.airlift.slice.SliceGets the value at theblockpositionas a Slice.For parameterized types returns the list of parameters.final TypeSignatureGets the name of this type which must be case insensitive globally unique.Class<? extends ValueBlock>Gets the ValueBlock type used to store values of this type.inthashCode()booleanTrue if the type supports equalTo and hash.booleanTrue if the type supports compareTo.toString()voidwriteBoolean(BlockBuilder blockBuilder, boolean value) Writes the boolean value into theBlockBuilder.voidwriteDouble(BlockBuilder blockBuilder, double value) Writes the double value into theBlockBuilder.voidwriteLong(BlockBuilder blockBuilder, long value) Writes the long value into theBlockBuilder.voidwriteObject(BlockBuilder blockBuilder, Object value) Writes the Object value into theBlockBuilder.voidwriteSlice(BlockBuilder blockBuilder, io.airlift.slice.Slice value) Writes the Slice value into theBlockBuilder.voidwriteSlice(BlockBuilder blockBuilder, io.airlift.slice.Slice value, int offset, int length) Writes the Slice value into theBlockBuilder.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.trino.spi.type.Type
appendTo, createBlockBuilder, createBlockBuilder, getBaseName, getDiscreteValues, getFlatFixedSize, getFlatVariableWidthSize, getNextValue, getObjectValue, getPreviousValue, getRange, getTypeId, getTypeOperatorDeclaration, isFlatVariableWidth, relocateFlatVariableWidthOffsets
-
Constructor Details
-
AbstractType
protected AbstractType(TypeSignature signature, Class<?> javaType, Class<? extends ValueBlock> valueBlockType)
-
-
Method Details
-
getTypeSignature
Description copied from interface:TypeGets the name of this type which must be case insensitive globally unique. The name of a user defined type must be a legal identifier in Trino.- Specified by:
getTypeSignaturein interfaceType
-
getDisplayName
Description copied from interface:TypeReturns the name of this type that should be displayed to end-users.- Specified by:
getDisplayNamein interfaceType
-
getJavaType
Description copied from interface:TypeGets the Java class type used to represent this value on the stack during expression execution.Currently, this can be
boolean,long,double, or a non-primitive type.- Specified by:
getJavaTypein interfaceType
-
getValueBlockType
Description copied from interface:TypeGets the ValueBlock type used to store values of this type.- Specified by:
getValueBlockTypein interfaceType
-
getTypeParameters
Description copied from interface:TypeFor parameterized types returns the list of parameters.- Specified by:
getTypeParametersin interfaceType
-
isComparable
public boolean isComparable()Description copied from interface:TypeTrue if the type supports equalTo and hash.- Specified by:
isComparablein interfaceType
-
isOrderable
public boolean isOrderable()Description copied from interface:TypeTrue if the type supports compareTo.- Specified by:
isOrderablein interfaceType
-
getBoolean
Description copied from interface:TypeGets the value at theblockpositionas a boolean.- Specified by:
getBooleanin interfaceType
-
writeBoolean
Description copied from interface:TypeWrites the boolean value into theBlockBuilder.- Specified by:
writeBooleanin interfaceType
-
getLong
Description copied from interface:TypeGets the value at theblockpositionas a long. -
writeLong
Description copied from interface:TypeWrites the long value into theBlockBuilder. -
getDouble
Description copied from interface:TypeGets the value at theblockpositionas a double. -
writeDouble
Description copied from interface:TypeWrites the double value into theBlockBuilder.- Specified by:
writeDoublein interfaceType
-
getSlice
Description copied from interface:TypeGets the value at theblockpositionas a Slice. -
writeSlice
Description copied from interface:TypeWrites the Slice value into theBlockBuilder.- Specified by:
writeSlicein interfaceType
-
writeSlice
public void writeSlice(BlockBuilder blockBuilder, io.airlift.slice.Slice value, int offset, int length) Description copied from interface:TypeWrites the Slice value into theBlockBuilder.- Specified by:
writeSlicein interfaceType
-
getObject
Description copied from interface:TypeGets the value at theblockpositionas an Object. -
writeObject
Description copied from interface:TypeWrites the Object value into theBlockBuilder.- Specified by:
writeObjectin interfaceType
-
toString
-
equals
-
hashCode
public int hashCode()
-