java.lang.Object
org.roaringbitmap.longlong.HighLowContainer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()clear to be a empty fresh oneclone()static intcompareUnsigned(byte[] a, byte[] b) Compares two unsigned byte arrays for order.get a container iteratorvoiddeserialize(DataInput dataInput) deserialize from the input byte streamvoiddeserialize(ByteBuffer buffer) deserialize from the input ByteBuffer in little endianbooleanlongfirst()Gets the first value in the arraygetContainer(long containerIdx) inthashCode()get a key iteratorhighKeyLeafNodeIterator(boolean reverse) highKeyLeafNodeIteratorFrom(long bound, boolean reverse) booleanisEmpty()whether it's emptylonglast()Gets the last value in the arrayvoidput the 48 bit key and the corresponding containervoidremove(byte[] highPart) Attempt to remove the container that corresponds to the 48 bit key.voidreplaceContainer(long containerIdx, Container container) replace the specified position one with a fresh containersearchContainer(byte[] highPart) search the container by the given 48 bit high part keysearchContainer(long highPart) search the container by the given 48 bit high part keyvoidserialize(DataOutput dataOutput) serialize into the byte streamvoidserialize(ByteBuffer buffer) serialize into the ByteBuffer in little endianlongserialized size in bytes
-
Constructor Details
-
HighLowContainer
public HighLowContainer()
-
-
Method Details
-
clone
-
getContainer
-
searchContainer
search the container by the given 48 bit high part key- Parameters:
highPart- the 48 bit key array- Returns:
- the container with the container index
-
searchContainer
search the container by the given 48 bit high part key- Parameters:
highPart- the 48 bit key array- Returns:
- the container with the container index
-
put
put the 48 bit key and the corresponding container- Parameters:
highPart- the 48 bit keycontainer- the container
-
remove
public void remove(byte[] highPart) Attempt to remove the container that corresponds to the 48 bit key.- Parameters:
highPart- the 48 bit key
-
containerIterator
get a container iterator- Returns:
- a container iterator
-
highKeyIterator
get a key iterator- Returns:
- a key iterator
-
highKeyLeafNodeIterator
- Parameters:
reverse- true ascending order, false: descending order- Returns:
- the leaf node iterator
-
highKeyLeafNodeIteratorFrom
-
replaceContainer
replace the specified position one with a fresh container- Parameters:
containerIdx- the position of the containercontainer- the fresh container
-
isEmpty
public boolean isEmpty()whether it's empty- Returns:
- true: empty,false: not empty
-
first
public long first()Gets the first value in the array- Returns:
- the first value in the array
- Throws:
NoSuchElementException- if empty
-
last
public long last()Gets the last value in the array- Returns:
- the last value in the array
- Throws:
NoSuchElementException- if empty
-
compareUnsigned
public static int compareUnsigned(byte[] a, byte[] b) Compares two unsigned byte arrays for order. Result is a negative integer, zero, or a positive integer as the first array is less than, equal to, or greater than the second.- Returns:
- result of comparing
-
serialize
serialize into the ByteBuffer in little endian- Parameters:
buffer- the ByteBuffer should be large enough to hold the data- Throws:
IOException- indicate exception happened
-
deserialize
deserialize from the input ByteBuffer in little endian- Parameters:
buffer- the ByteBuffer- Throws:
IOException- indicate exception happened
-
serializedSizeInBytes
public long serializedSizeInBytes()serialized size in bytes- Returns:
- the size in bytes
-
serialize
serialize into the byte stream- Parameters:
dataOutput- the output stream- Throws:
IOException- indicate the io exception happened
-
deserialize
deserialize from the input byte stream- Parameters:
dataInput- the input byte stream- Throws:
IOException- indicate the io exception happened
-
clear
public void clear()clear to be a empty fresh one -
hashCode
public int hashCode() -
equals
-