public class SpatialDataType extends BasicDataType<Spatial>
| Constructor and Description |
|---|
SpatialDataType(int dimensions) |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(Spatial a,
Spatial b)
Compare two keys.
|
boolean |
contains(java.lang.Object objA,
java.lang.Object objB)
Check whether a contains b.
|
protected Spatial |
create(long id,
float... minMax)
Creates spatial object with specified parameters.
|
Spatial[] |
createStorage(int size)
Create storage object of array type to hold values
|
boolean |
equals(java.lang.Object a,
java.lang.Object b)
Check whether two spatial values are equal.
|
float |
getAreaIncrease(java.lang.Object objA,
java.lang.Object objB)
Get the area increase by extending a to contain b.
|
int[] |
getExtremes(java.util.ArrayList<java.lang.Object> list)
Get the most extreme pair (elements that are as far apart as possible).
|
int |
getMemory(Spatial obj)
Calculates the amount of used memory in bytes.
|
void |
increaseBounds(java.lang.Object bounds,
java.lang.Object add)
Increase the bounds in the given spatial object.
|
boolean |
isInside(java.lang.Object objA,
java.lang.Object objB)
Check whether a is completely inside b and does not touch the
given bound.
|
boolean |
isOverlap(Spatial a,
Spatial b)
Check whether the two objects overlap.
|
Spatial |
read(java.nio.ByteBuffer buff)
Read an object.
|
void |
write(WriteBuffer buff,
Spatial k)
Write an object.
|
binarySearch, cast, equals, hashCode, isMemoryEstimationAllowed, read, writeprotected Spatial create(long id, float... minMax)
id - the IDminMax - min x, max x, min y, max y, and so onpublic Spatial[] createStorage(int size)
DataTypesize - number of values to holdpublic int compare(Spatial a, Spatial b)
DataTypepublic boolean equals(java.lang.Object a,
java.lang.Object b)
a - the first valueb - the second valuepublic int getMemory(Spatial obj)
DataTypepublic void write(WriteBuffer buff, Spatial k)
DataTypepublic Spatial read(java.nio.ByteBuffer buff)
DataTypepublic boolean isOverlap(Spatial a, Spatial b)
a - the first objectb - the second objectpublic void increaseBounds(java.lang.Object bounds,
java.lang.Object add)
bounds - the bounds (may be modified)add - the valuepublic float getAreaIncrease(java.lang.Object objA,
java.lang.Object objB)
objA - the bounding boxobjB - the objectpublic boolean contains(java.lang.Object objA,
java.lang.Object objB)
objA - the bounding boxobjB - the objectpublic boolean isInside(java.lang.Object objA,
java.lang.Object objB)
objA - the object to checkobjB - the boundspublic int[] getExtremes(java.util.ArrayList<java.lang.Object> list)
list - the objects