| Modifier and Type | Field and Description |
|---|---|
| private static final MultiDimension |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private void | combineEntries(ArrayList<long[]>
list of pairs(low, high) list, int product of the gap lengths total)Combine entries if the size of the list is too large. |
| public int | compare(long[]
the first object to be compared. a, long[] the second object to be compared. b)Implements java. Compares its two arguments for order. |
| public int | Returns: the valuethe number of dimensions dimensions, long the scalar value scalar, int the dimension of the returned value (starting from 0) dim)Gets one of the original multi-dimensional values from a scalar value. |
| private static int | |
| public String | Returns: the querythe table name table, String the column name of the computed scalar column scalarColumn, String[] the list of columns columns)Generates an optimized multi-dimensional range query. |
| private static int | |
| public static MultiDimension | |
| public int | Returns: the maximum valuethe number of dimensions dimensions)Get the maximum value for the given dimension count. |
| private long[][] | Returns: the list of ranges (low, high pairs)the minimum value min, int[] the maximum value max)Gets a list of ranges to be searched for a multi-dimensional range query where min <= value <= max. |
| public ResultSet | Returns: the result setthe prepared statement prep, int[] the lower values min, int[] the upper values max)Executes a prepared query that was generated using generatePreparedQuery. |
| private static int | |
| public long | Returns: the scalar valuethe multi-dimensional value values)Convert the multi-dimensional value into a one-dimensional (scalar) value. |
| public long | Returns: the scalar valuethe value of the first dimension, normalized x, int the value of the second dimension, normalized y)Convert the two-dimensional value into a one-dimensional (scalar) value. |
| public int | Returns: the normalized value in the range 0..getMaxValue(dimensions)the number of dimensions dimensions, double the value (must be in the range min..max) value, double the minimum value min, double the maximum value (must be larger than min) max)Normalize a value so that it is between the minimum and maximum for the given number of dimensions. |
| private static int |
| INSTANCE | back to summary |
|---|---|
| private static final MultiDimension INSTANCE | |
| MultiDimension | back to summary |
|---|---|
| protected MultiDimension() Protected constructor | |
| addMortonRanges | back to summary |
|---|---|
| private void addMortonRanges(ArrayList<long[]> list, int[] min, int[] max, int len, int level) | |
| combineEntries | back to summary |
|---|---|
| private void combineEntries(ArrayList<long[]> list, int total) Combine entries if the size of the list is too large.
| |
| compare | back to summary |
|---|---|
| public int compare(long[] a, long[] b) Implements java. Doc from java. Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
The implementor must ensure that
The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| deinterleave | back to summary |
|---|---|
| public int deinterleave(int dimensions, long scalar, int dim) Gets one of the original multi-dimensional values from a scalar value.
| |
| findMiddle | back to summary |
|---|---|
| private static int findMiddle(int a, int b) | |
| generatePreparedQuery | back to summary |
|---|---|
| public String generatePreparedQuery(String table, String scalarColumn, String[] columns) Generates an optimized multi-dimensional range query. The query contains parameters. It can only be used with the H2 database. | |
| getBitsPerValue | back to summary |
|---|---|
| private static int getBitsPerValue(int dimensions) | |
| getInstance | back to summary |
|---|---|
| public static MultiDimension getInstance() Get the singleton.
| |
| getMaxValue | back to summary |
|---|---|
| public int getMaxValue(int dimensions) Get the maximum value for the given dimension count. For two dimensions, each value must contain at most 32 bit, for 3: 21 bit, 4: 16 bit, 5: 12 bit, 6: 10 bit, 7: 9 bit, 8: 8 bit.
| |
| getMortonRanges | back to summary |
|---|---|
| private long[][] getMortonRanges(int[] min, int[] max) Gets a list of ranges to be searched for a multi-dimensional range query where min <= value <= max. In most cases, the ranges will be larger than required in order to combine smaller ranges into one. Usually, about double as many points will be included in the resulting range.
| |
| getResult | back to summary |
|---|---|
| public ResultSet getResult(PreparedStatement prep, int[] min, int[] max) throws SQLException Executes a prepared query that was generated using generatePreparedQuery.
| |
| getSize | back to summary |
|---|---|
| private static int getSize(int[] min, int[] max, int len) | |
| interleave | back to summary |
|---|---|
| public long interleave(int... values) Convert the multi-dimensional value into a one-dimensional (scalar) value. This is done by interleaving the bits of the values. Each values must be between 0 (including) and the maximum value for the given number of dimensions (getMaxValue, excluding). To normalize values to this range, use the normalize function.
| |
| interleave | back to summary |
|---|---|
| public long interleave(int x, int y) Convert the two-dimensional value into a one-dimensional (scalar) value. This is done by interleaving the bits of the values. Each values must be between 0 (including) and the maximum value for the given number of dimensions (getMaxValue, excluding). To normalize values to this range, use the normalize function.
| |
| normalize | back to summary |
|---|---|
| public int normalize(int dimensions, double value, double min, double max) Normalize a value so that it is between the minimum and maximum for the given number of dimensions.
| |
| roundUp | back to summary |
|---|---|
| private static int roundUp(int x, int blockSizePowerOf2) | |