Top Description Fields Constructors Methods
org.h2.result

public abstract Class SearchRow

extends Value
Class Inheritance
Known Direct Subclasses
org.h2.result.SimpleRowValue, org.h2.result.Row
Imports
org.h2.engine.CastDataProvider, org.h2.value.CompareMode, .TypeInfo, .Value, .ValueNull

The base class for rows stored in a table, and for partial rows stored in the index.

Field Summary

Modifier and TypeField and Description
protected long
key

The row key.

public static long
MATCH_ALL_ROW_KEY

If the key is this value, then the key is considered equal to all other keys, when comparing.

public static final int
MEMORY_CALCULATE

The constant that means "memory usage is unknown and needs to be calculated first".

public static final int
ROWID_INDEX

Index of a virtual "_ROWID_" column within a row or a table

Inherited from org.h2.value.Value:
ARRAYASSIGN_TOBIGINTBINARYBLOBBOOLEANCAST_TOCHARCLOBCONVERT_TODATEDECFLOATDOUBLEEMPTY_VALUESENUMGEOMETRYINTEGERINTERVAL_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
public

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 abstract void
copyFrom(SearchRow
source of column values
source
)

Copy all relevant values from the source to this row.

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 abstract int

Returns:

the column count
getColumnCount
()

Get the column count.

public long

Returns:

the key
getKey
()

Get the unique key of the row.

public abstract int

Returns:

the memory
getMemory
()

Overrides org.h2.value.Value.getMemory.

Get the estimated memory used for this row, in bytes.

public StringBuilder
getSQL(StringBuilder
string builder
builder
,
int
formatting flags
sqlFlags
)

Implements org.h2.util.HasSQL.getSQL.

Appends the SQL statement of this object to the specified builder.

public String
getString()

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

Get the value as a string.

public TypeInfo
getType()

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

Implements org.h2.value.Typed.getType.

Returns the data type.

public abstract Value

Returns:

the value
getValue
(int
the column number (starting with 0)
index
)

Get the value for the column

public int
getValueType()

Implements abstract org.h2.value.Value.getValueType.

Get the value type.

public int
hashCode()

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

Returns a hash code value for this object.

public boolean

Returns:

true if NULL
isNull
(int
column index
index
)

Determine if specified column contains NULL

public void
setKey(long
the key
key
)

Set the unique key of the row.

public abstract void
setValue(int
the column number (starting with 0)
index
,
Value
the new value
v
)

Set the value for given column

Inherited from org.h2.value.Value:
addcastTocharLengthclearCachecompareTocompareWithNullcontainsNullconvertForAssignToconvertToconvertToconvertToconvertToconvertToconvertToAnyArrayconvertToAnyJsonconvertToAnyRowconvertToBigintconvertToBooleanconvertToCharconvertToDateconvertToDoubleconvertToEnumconvertToGeometryconvertToIntconvertToIntconvertToJavaObjectconvertToJsonconvertToLongconvertToRealconvertToSmallintconvertToTinyintconvertToUuiddividegetBigDecimalgetBooleangetBytegetBytesgetBytesNoCopygetDoublegetFloatgetHigherOrdergetInputStreamgetInputStreamgetIntgetLonggetReadergetReadergetShortgetSignumgetTypeNamegetUnsupportedExceptionForOperationgetValueWithFirstNullisFalseisTruemodulusmultiplynegateoctetLengthsubtracttoString

Field Detail

keyback to summary
protected long key

The row key.

MATCH_ALL_ROW_KEYback to summary
public static long MATCH_ALL_ROW_KEY

If the key is this value, then the key is considered equal to all other keys, when comparing.

MEMORY_CALCULATEback to summary
public static final int MEMORY_CALCULATE

The constant that means "memory usage is unknown and needs to be calculated first".

ROWID_INDEXback to summary
public static final int ROWID_INDEX

Index of a virtual "_ROWID_" column within a row or a table

Constructor Detail

SearchRowback to summary
public SearchRow()

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
copyFromback to summary
public abstract void copyFrom(SearchRow source)

Copy all relevant values from the source to this row.

Parameters
source:SearchRow

source of column values

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
getColumnCountback to summary
public abstract int getColumnCount()

Get the column count.

Returns:int

the column count

getKeyback to summary
public long getKey()

Get the unique key of the row.

Returns:long

the key

getMemoryback to summary
public abstract int getMemory()

Overrides org.h2.value.Value.getMemory.

Get the estimated memory used for this row, in bytes.

Returns:int

the memory

Annotations
@Override
getSQLback to summary
public StringBuilder getSQL(StringBuilder builder, int sqlFlags)

Implements org.h2.util.HasSQL.getSQL.

Doc from org.h2.util.HasSQL.getSQL.

Appends the SQL statement of this object to the specified builder.

Parameters
builder:StringBuilder

string builder

sqlFlags:int

formatting flags

Returns:StringBuilder

the specified string builder

Annotations
@Override
getStringback to summary
public 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 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
getValueback to summary
public abstract Value getValue(int index)

Get the value for the column

Parameters
index:int

the column number (starting with 0)

Returns:Value

the value

getValueTypeback to summary
public int getValueType()

Implements abstract org.h2.value.Value.getValueType.

Doc from org.h2.value.Value.getValueType.

Get the value type.

Returns:int

the value 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
isNullback to summary
public boolean isNull(int index)

Determine if specified column contains NULL

Parameters
index:int

column index

Returns:boolean

true if NULL

setKeyback to summary
public void setKey(long key)

Set the unique key of the row.

Parameters
key:long

the key

setValueback to summary
public abstract void setValue(int index, Value v)

Set the value for given column

Parameters
index:int

the column number (starting with 0)

v:Value

the new value