Package org.roaringbitmap.longlong
Class HighLowContainer
- java.lang.Object
-
- org.roaringbitmap.longlong.HighLowContainer
-
public class HighLowContainer extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private Art
art
private Containers
containers
private static byte
EMPTY_TAG
private static byte
NOT_EMPTY_TAG
-
Constructor Summary
Constructors Constructor Description HighLowContainer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
assertNonEmpty()
void
clear()
clear to be a empty fresh oneContainerIterator
containerIterator()
get a container iteratorvoid
deserialize(java.io.DataInput dataInput)
deserialize from the input byte streamvoid
deserialize(java.nio.ByteBuffer buffer)
deserialize from the input ByteBuffer in little endianboolean
equals(java.lang.Object object)
long
first()
Gets the first value in the arrayContainer
getContainer(long containerIdx)
int
hashCode()
KeyIterator
highKeyIterator()
get a key iteratorLeafNodeIterator
highKeyLeafNodeIterator(boolean reverse)
LeafNodeIterator
highKeyLeafNodeIteratorFrom(long bound, boolean reverse)
boolean
isEmpty()
whether it's emptylong
last()
Gets the last value in the arrayvoid
put(byte[] highPart, Container container)
put the 48 bit key and the corresponding containervoid
remove(byte[] highPart)
Attempt to remove the container that corresponds to the 48 bit key.void
replaceContainer(long containerIdx, Container container)
replace the specified position one with a fresh containerContainerWithIndex
searchContainer(byte[] highPart)
search the container by the given 48 bit high part keyvoid
serialize(java.io.DataOutput dataOutput)
serialize into the byte streamvoid
serialize(java.nio.ByteBuffer buffer)
serialize into the ByteBuffer in little endianlong
serializedSizeInBytes()
serialized size in bytes
-
-
-
Field Detail
-
art
private Art art
-
containers
private Containers containers
-
EMPTY_TAG
private static final byte EMPTY_TAG
- See Also:
- Constant Field Values
-
NOT_EMPTY_TAG
private static final byte NOT_EMPTY_TAG
- See Also:
- Constant Field Values
-
-
Method Detail
-
getContainer
public Container getContainer(long containerIdx)
-
searchContainer
public ContainerWithIndex searchContainer(byte[] highPart)
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
public void put(byte[] highPart, Container container)
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
public ContainerIterator containerIterator()
get a container iterator- Returns:
- a container iterator
-
highKeyIterator
public KeyIterator highKeyIterator()
get a key iterator- Returns:
- a key iterator
-
highKeyLeafNodeIterator
public LeafNodeIterator highKeyLeafNodeIterator(boolean reverse)
- Parameters:
reverse
- true ascending order, false: descending order- Returns:
- the leaf node iterator
-
highKeyLeafNodeIteratorFrom
public LeafNodeIterator highKeyLeafNodeIteratorFrom(long bound, boolean reverse)
-
replaceContainer
public void replaceContainer(long containerIdx, Container container)
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
-
assertNonEmpty
private void assertNonEmpty()
-
first
public long first()
Gets the first value in the array- Returns:
- the first value in the array
- Throws:
java.util.NoSuchElementException
- if empty
-
last
public long last()
Gets the last value in the array- Returns:
- the last value in the array
- Throws:
java.util.NoSuchElementException
- if empty
-
serialize
public void serialize(java.nio.ByteBuffer buffer) throws java.io.IOException
serialize into the ByteBuffer in little endian- Parameters:
buffer
- the ByteBuffer should be large enough to hold the data- Throws:
java.io.IOException
- indicate exception happened
-
deserialize
public void deserialize(java.nio.ByteBuffer buffer) throws java.io.IOException
deserialize from the input ByteBuffer in little endian- Parameters:
buffer
- the ByteBuffer- Throws:
java.io.IOException
- indicate exception happened
-
serializedSizeInBytes
public long serializedSizeInBytes()
serialized size in bytes- Returns:
- the size in bytes
-
serialize
public void serialize(java.io.DataOutput dataOutput) throws java.io.IOException
serialize into the byte stream- Parameters:
dataOutput
- the output stream- Throws:
java.io.IOException
- indicate the io exception happened
-
deserialize
public void deserialize(java.io.DataInput dataInput) throws java.io.IOException
deserialize from the input byte stream- Parameters:
dataInput
- the input byte stream- Throws:
java.io.IOException
- indicate the io exception happened
-
clear
public void clear()
clear to be a empty fresh one
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equals
in classjava.lang.Object
-
-