Top Description Fields Constructors Methods
org.h2.value

pack-priv abstract Class ValueStringBase

extends Value
Class Inheritance
Known Direct Subclasses
org.h2.value.ValueVarchar, org.h2.value.ValueVarcharIgnoreCase, org.h2.value.ValueChar
Imports
java.math.BigDecimal, java.nio.charset.StandardCharsets, org.h2.api.ErrorCode, org.h2.engine.CastDataProvider, .Constants, org.h2.message.DbException

Base implementation of String based data types.

Field Summary

Modifier and TypeField and Description
private TypeInfo
pack-priv String
value

The value.

Inherited from org.h2.value.Value:
ARRAYASSIGN_TOBIGINTBINARYBLOBBOOLEANCAST_TOCHARCLOBCONVERT_TODATEDECFLOATDOUBLEEMPTY_VALUESENUMGEOMETRYGROUP_BINARY_STRINGGROUP_BOOLEANGROUP_CHARACTER_STRINGGROUP_COLLECTIONGROUP_DATETIMEGROUP_INTERVAL_DTGROUP_INTERVAL_YMGROUP_NULLGROUP_NUMERICGROUP_OTHERGROUPSINTEGERINTERVAL_DAYINTERVAL_DAY_TO_HOURINTERVAL_DAY_TO_MINUTEINTERVAL_DAY_TO_SECONDINTERVAL_HOURINTERVAL_HOUR_TO_MINUTEINTERVAL_HOUR_TO_SECONDINTERVAL_MINUTEINTERVAL_MINUTE_TO_SECONDINTERVAL_MONTHINTERVAL_SECONDINTERVAL_YEARINTERVAL_YEAR_TO_MONTHJAVA_OBJECTJSONMAX_LONG_DECIMALMIN_LONG_DECIMALNULLNUMERICREALROWSMALLINTTIMETIME_TZTIMESTAMPTIMESTAMP_TZTINYINTTYPE_COUNTUNKNOWNUUIDVARBINARYVARCHARVARCHAR_IGNORECASE

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public int
compareTypeSafe(Value
the other value
v
,
CompareMode
the compare mode
mode
,
CastDataProvider
the cast information provider
provider
)

Implements abstract org.h2.value.Value.compareTypeSafe.

Compare this value against another value given that the values are of the same data type.

public boolean
equals(Object
the other value
other
)

Implements abstract org.h2.value.Value.equals.

Check if the two values have the same hash code.

public final BigDecimal
public final boolean
getBoolean()

Overrides org.h2.value.Value.getBoolean.

Returns this value as a Java boolean value.

public final byte
getByte()

Overrides org.h2.value.Value.getByte.

Returns this value as a Java byte value.

public final byte[]
public final double
getDouble()

Overrides org.h2.value.Value.getDouble.

Returns this value as a Java double value.

public final float
getFloat()

Overrides org.h2.value.Value.getFloat.

Returns this value as a Java float value.

public final int
getInt()

Overrides org.h2.value.Value.getInt.

Returns this value as a Java int value.

public final long
getLong()

Overrides org.h2.value.Value.getLong.

Returns this value as a Java long value.

public final int
getMemory()

Overrides org.h2.value.Value.getMemory.

Get the memory used by this object.

public final short
getShort()

Overrides org.h2.value.Value.getShort.

Returns this value as a Java short value.

public final String
getString()

Implements abstract org.h2.value.Value.getString.

Get the value as a string.

public final TypeInfo
getType()

Implements abstract org.h2.value.Value.getType.

Implements org.h2.value.Typed.getType.

Returns the data type.

public int
hashCode()

Implements abstract org.h2.value.Value.hashCode.

Returns a hash code value for this object.

Inherited from org.h2.value.Value:
addcachecastTocharLengthclearCachecompareTocompareWithNullcontainsNullconvertForAssignToconvertToconvertToconvertToconvertToconvertToconvertToAnyArrayconvertToAnyJsonconvertToAnyRowconvertToBigintconvertToBooleanconvertToCharconvertToDateconvertToDoubleconvertToEnumconvertToGeometryconvertToIntconvertToIntconvertToJavaObjectconvertToJsonconvertToLongconvertToRealconvertToSmallintconvertToTinyintconvertToUuiddividegetBytesNoCopygetDataConversionErrorgetDataConversionErrorgetHigherOrdergetHigherOrderKnowngetInputStreamgetInputStreamgetReadergetReadergetSignumgetTypeNamegetUnsupportedExceptionForOperationgetValueTooLongExceptiongetValueTypegetValueWithFirstNullgetValueWithFirstNullImplisFalseisTruemodulusmultiplynegateoctetLengthrangeChecksubtracttoString

Field Detail

typeback to summary
private TypeInfo type
valueback to summary
pack-priv String value

The value.

Constructor Detail

ValueStringBaseback to summary
pack-priv ValueStringBase(String v)

Method Detail

compareTypeSafeback to summary
public int compareTypeSafe(Value v, CompareMode mode, CastDataProvider provider)

Implements abstract org.h2.value.Value.compareTypeSafe.

Doc from org.h2.value.Value.compareTypeSafe.

Compare this value against another value given that the values are of the same data type.

Parameters
v:Value

the other value

mode:CompareMode

the compare mode

provider:CastDataProvider

the cast information provider

Returns:int

0 if both values are equal, -1 if the other value is smaller, and 1 otherwise

Annotations
@Override
equalsback to summary
public boolean equals(Object other)

Implements abstract org.h2.value.Value.equals.

Doc from org.h2.value.Value.equals.

Check if the two values have the same hash code. No data conversion is made; this method returns false if the other object is not of the same class. For some values, compareTo may return 0 even if equals return false. Example: ValueDecimal 0.0 and 0.00.

Parameters
other:Object

the other value

Returns:boolean

true if they are equal

Annotations
@Override
getBigDecimalback to summary
public final BigDecimal getBigDecimal()

Overrides org.h2.value.Value.getBigDecimal.

Annotations
@Override
getBooleanback to summary
public final boolean getBoolean()

Overrides org.h2.value.Value.getBoolean.

Doc from org.h2.value.Value.getBoolean.

Returns this value as a Java boolean value.

Returns:boolean

value

Annotations
@Override
getByteback to summary
public final byte getByte()

Overrides org.h2.value.Value.getByte.

Doc from org.h2.value.Value.getByte.

Returns this value as a Java byte value.

Returns:byte

value

Annotations
@Override
getBytesback to summary
public final byte[] getBytes()

Overrides org.h2.value.Value.getBytes.

Annotations
@Override
getDoubleback to summary
public final double getDouble()

Overrides org.h2.value.Value.getDouble.

Doc from org.h2.value.Value.getDouble.

Returns this value as a Java double value.

Returns:double

value

Annotations
@Override
getFloatback to summary
public final float getFloat()

Overrides org.h2.value.Value.getFloat.

Doc from org.h2.value.Value.getFloat.

Returns this value as a Java float value.

Returns:float

value

Annotations
@Override
getIntback to summary
public final int getInt()

Overrides org.h2.value.Value.getInt.

Doc from org.h2.value.Value.getInt.

Returns this value as a Java int value.

Returns:int

value

Annotations
@Override
getLongback to summary
public final long getLong()

Overrides org.h2.value.Value.getLong.

Doc from org.h2.value.Value.getLong.

Returns this value as a Java long value.

Returns:long

value

Annotations
@Override
getMemoryback to summary
public final int getMemory()

Overrides org.h2.value.Value.getMemory.

Doc from org.h2.value.Value.getMemory.

Get the memory used by this object.

Returns:int

the memory used in bytes

Annotations
@Override
getShortback to summary
public final short getShort()

Overrides org.h2.value.Value.getShort.

Doc from org.h2.value.Value.getShort.

Returns this value as a Java short value.

Returns:short

value

Annotations
@Override
getStringback to summary
public final String getString()

Implements abstract org.h2.value.Value.getString.

Doc from org.h2.value.Value.getString.

Get the value as a string.

Returns:String

the string

Annotations
@Override
getTypeback to summary
public final TypeInfo getType()

Implements abstract org.h2.value.Value.getType.

Implements org.h2.value.Typed.getType.

Doc from org.h2.value.Typed.getType.

Returns the data type.

Returns:TypeInfo

the data type

Annotations
@Override
hashCodeback to summary
public int hashCode()

Implements abstract org.h2.value.Value.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override