Top Description Fields Constructors Methods
org.h2.mvstore.db

public Class SpatialKey

extends Value
implements Spatial
Class Inheritance
All Implemented Interfaces
org.h2.mvstore.rtree.Spatial
Imports
java.util.Arrays, org.h2.engine.CastDataProvider, org.h2.mvstore.rtree.Spatial, org.h2.value.CompareMode, .TypeInfo, .Value

A unique spatial key.

Field Summary

Modifier and TypeField and Description
private final long
private final float[]
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
SpatialKey(long
the id
id
,
float...
min x, max x, min y, max y, and so on
minMax
)

Create a new key.

public
SpatialKey(long id, SpatialKey other)

Method Summary

Modifier and TypeMethod and Description
public Spatial
clone(long
for the new Spatial object
id
)

Implements org.h2.mvstore.rtree.Spatial.clone.

Creates a copy of this Spatial object with different id.

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 boolean

Returns:

true if the contents are the same
equalsIgnoringId
(Spatial
the other key
o
)

Implements org.h2.mvstore.rtree.Spatial.equalsIgnoringId.

Check whether two objects are equals, but do not compare the id fields.

public long
getId()

Implements org.h2.mvstore.rtree.Spatial.getId.

Get id of this Spatial object

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 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
isNull()

Implements org.h2.mvstore.rtree.Spatial.isNull.

Test whether this object has no value

public float
max(int
the dimension
dim
)

Implements org.h2.mvstore.rtree.Spatial.max.

Get the maximum value for the given dimension.

public float
min(int
the dimension
dim
)

Implements org.h2.mvstore.rtree.Spatial.min.

Get the minimum value for the given dimension.

public void
setMax(int
the dimension
dim
,
float
the value
x
)

Implements org.h2.mvstore.rtree.Spatial.setMax.

Set the maximum value for the given dimension.

public void
setMin(int
the dimension
dim
,
float
the value
x
)

Implements org.h2.mvstore.rtree.Spatial.setMin.

Set the minimum value for the given dimension.

public String
toString()

Overrides org.h2.value.Value.toString.

Returns a string representation of the object.

Inherited from org.h2.value.Value:
addcastTocharLengthclearCachecompareTocompareWithNullcontainsNullconvertForAssignToconvertToconvertToconvertToconvertToconvertToconvertToAnyArrayconvertToAnyJsonconvertToAnyRowconvertToBigintconvertToBooleanconvertToCharconvertToDateconvertToDoubleconvertToEnumconvertToGeometryconvertToIntconvertToIntconvertToJavaObjectconvertToJsonconvertToLongconvertToRealconvertToSmallintconvertToTinyintconvertToUuiddividegetBigDecimalgetBooleangetBytegetBytesgetBytesNoCopygetDoublegetFloatgetHigherOrdergetInputStreamgetInputStreamgetIntgetLonggetMemorygetReadergetReadergetShortgetSignumgetTypeNamegetUnsupportedExceptionForOperationgetValueWithFirstNullisFalseisTruemodulusmultiplynegateoctetLengthsubtract

Field Detail

idback to summary
private final long id
minMaxback to summary
private final float[] minMax

Constructor Detail

SpatialKeyback to summary
public SpatialKey(long id, float... minMax)

Create a new key.

Parameters
id:long

the id

minMax:float[]

min x, max x, min y, max y, and so on

SpatialKeyback to summary
public SpatialKey(long id, SpatialKey other)

Method Detail

cloneback to summary
public Spatial clone(long id)

Implements org.h2.mvstore.rtree.Spatial.clone.

Doc from org.h2.mvstore.rtree.Spatial.clone.

Creates a copy of this Spatial object with different id.

Parameters
id:long

for the new Spatial object

Returns:Spatial

a clone

Annotations
@Override
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
equalsIgnoringIdback to summary
public boolean equalsIgnoringId(Spatial o)

Implements org.h2.mvstore.rtree.Spatial.equalsIgnoringId.

Check whether two objects are equals, but do not compare the id fields.

Parameters
o:Spatial

the other key

Returns:boolean

true if the contents are the same

Annotations
@Override
getIdback to summary
public long getId()

Implements org.h2.mvstore.rtree.Spatial.getId.

Doc from org.h2.mvstore.rtree.Spatial.getId.

Get id of this Spatial object

Returns:long

id

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
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()

Implements org.h2.mvstore.rtree.Spatial.isNull.

Doc from org.h2.mvstore.rtree.Spatial.isNull.

Test whether this object has no value

Returns:boolean

true if it is NULL, false otherwise

Annotations
@Override
maxback to summary
public float max(int dim)

Implements org.h2.mvstore.rtree.Spatial.max.

Doc from org.h2.mvstore.rtree.Spatial.max.

Get the maximum value for the given dimension.

Parameters
dim:int

the dimension

Returns:float

the value

Annotations
@Override
minback to summary
public float min(int dim)

Implements org.h2.mvstore.rtree.Spatial.min.

Doc from org.h2.mvstore.rtree.Spatial.min.

Get the minimum value for the given dimension.

Parameters
dim:int

the dimension

Returns:float

the value

Annotations
@Override
setMaxback to summary
public void setMax(int dim, float x)

Implements org.h2.mvstore.rtree.Spatial.setMax.

Doc from org.h2.mvstore.rtree.Spatial.setMax.

Set the maximum value for the given dimension.

Parameters
dim:int

the dimension

x:float

the value

Annotations
@Override
setMinback to summary
public void setMin(int dim, float x)

Implements org.h2.mvstore.rtree.Spatial.setMin.

Doc from org.h2.mvstore.rtree.Spatial.setMin.

Set the minimum value for the given dimension.

Parameters
dim:int

the dimension

x:float

the value

Annotations
@Override
toStringback to summary
public String toString()

Overrides org.h2.value.Value.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override