public class ZOrder extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_INPUT_DIMENSIONS |
| Constructor and Description |
|---|
ZOrder(List<Integer> encodingBits) |
ZOrder(List<Integer> encodingBits,
boolean positiveIntegersOnly)
Class constructor specifying the number of bits each value will take up for encoding and decoding.
|
| Modifier and Type | Method and Description |
|---|---|
List<Integer> |
decode(byte[] address)
Decodes the z-address into its corresponding input list.
|
List<Integer> |
decode(int address)
Decodes the z-address into its corresponding input list.
|
List<Integer> |
decode(long address)
Decodes the z-address into its corresponding input list.
|
byte[] |
encodeToByteArray(List<Integer> input)
Encodes the input list into its corresponding z-address and returns a byte array, with the least significant bit at index 0.
|
int |
encodeToInteger(List<Integer> input)
Encodes the input list into its corresponding z-address and returns an integer.
|
long |
encodeToLong(List<Integer> input)
Encodes the input list into its corresponding z-address and returns a long.
|
long |
zOrderByteAddressToLong(byte[] byteAddress)
Converts the byte array representation of a z-address into its long representation.
|
byte[] |
zOrderLongToByteAddress(long address)
Converts the long representation of a z-address into its byte array representation.
|
List<ZAddressRange<Integer>> |
zOrderSearchCurveIntegers(List<ZValueRange> ranges)
Searches for and outputs ranges of integer addresses within certain ranges in each dimension.
|
List<ZAddressRange<Long>> |
zOrderSearchCurveLongs(List<ZValueRange> ranges)
Searches for and outputs ranges of long addresses within certain ranges in each dimension.
|
public static final int MAX_INPUT_DIMENSIONS
public ZOrder(List<Integer> encodingBits, boolean positiveIntegersOnly)
public byte[] encodeToByteArray(List<Integer> input)
encode interweaves the bit representations of the input values from the most significant bit to create the final z-address.
For example: for a list of (7, 128) = (0b00000111, 0b10000000), encode returns a z-address of 16426 = 0b0100000000101010.input - the list of integer values to be encodedpublic long encodeToLong(List<Integer> input)
input - the list of integer values to be encodedpublic int encodeToInteger(List<Integer> input)
input - the list of integer values to be encodedpublic List<Integer> decode(byte[] address)
decode returns a list of (7, 128) = (0b00000111, 0b10000000).address - the byte address representation of the z-addresspublic List<Integer> decode(long address)
address - the long representation of the z-addresspublic List<Integer> decode(int address)
address - the integer representation of the z-addresspublic long zOrderByteAddressToLong(byte[] byteAddress)
byteAddress - the byte array representation of the z-addresspublic byte[] zOrderLongToByteAddress(long address)
address - the long representation of the z-addresspublic List<ZAddressRange<Long>> zOrderSearchCurveLongs(List<ZValueRange> ranges)
public List<ZAddressRange<Integer>> zOrderSearchCurveIntegers(List<ZValueRange> ranges)
Copyright © 2012–2022. All rights reserved.