Top Description Inners Fields Constructors Methods
com.carrotsearch.hppc

public Class SortedIterationLongByteHashMap

extends Object
implements LongByteMap
Class Inheritance
All Implemented Interfaces
com.carrotsearch.hppc.LongByteMap, com.carrotsearch.hppc.LongByteAssociativeContainer, java.lang.Iterable
Annotations
@Generated:SortedIterationKTypeVTypeHashMap.java
date:2024-06-04T15:20:17+0200
Imports
com.carrotsearch.hppc.comparators.*, com.carrotsearch.hppc.cursors.*, com.carrotsearch.hppc.predicates.*, com.carrotsearch.hppc.procedures.*, com.carrotsearch.hppc.sorting.QuickSort, java.util.Iterator, java.util.function.IntBinaryOperator

Read-only view with sorted iteration order on a delegate LongByteHashMap.

In its constructor, this view creates its own iteration order array and sorts it, which is in O(n.log(n)) of the size of the delegate map. Afterward, calls to any method have the same performance as the delegate map.

This view is read-only. In addition, the delegate map must not be modified while the view is used, otherwise the iteration is undefined.

Since this view provides a fixed iteration order, it must not be used to add entries to another LongByteHashMap as this may result in a runtime deadlock. See HPPC-103 and HPPC-186 for more information.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class
SortedIterationLongByteHashMap.KeysContainer

A view of the keys in sorted order.

private class
SortedIterationLongByteHashMap.KeysIterator

A sorted iterator over the set of assigned keys.

private class
SortedIterationLongByteHashMap.ValuesContainer

A view of the values in sorted order.

private class
SortedIterationLongByteHashMap.ValuesIterator

A sorted iterator over the set of assigned values.

Field Summary

Modifier and TypeField and Description
public final LongByteHashMap
public final int[]

Constructor Summary

AccessConstructor and Description
public
SortedIterationLongByteHashMap(LongByteHashMap delegate, LongComparator comparator)

Creates a read-only view with sorted iteration order on the given delegate map.

public
SortedIterationLongByteHashMap(LongByteHashMap delegate, LongByteComparator comparator)

Creates a read-only view with sorted iteration order on the given delegate map.

Method Summary

Modifier and TypeMethod and Description
public byte
addTo(long
The key of the value to adjust.
key
,
byte
The value to put or add to the existing value if key exists.
additionValue
)

Implements com.carrotsearch.hppc.LongByteMap.addTo.

An equivalent of calling

putOrAdd(key, additionValue, additionValue);
private boolean
public void
clear()

Implements com.carrotsearch.hppc.LongByteMap.clear.

Clear all keys and values in the container.

public boolean
containsKey(long key)

Implements com.carrotsearch.hppc.LongByteAssociativeContainer.containsKey.

Returns true if this container has an association to a value for the given key.

private int[]
public <T extends LongByteProcedure> T
forEach(T procedure)

Implements com.carrotsearch.hppc.LongByteAssociativeContainer.forEach, com.carrotsearch.hppc.LongByteAssociativeContainer.forEach.

Applies a given procedure to all keys-value pairs in this container.

public <T extends LongBytePredicate> T
forEach(T predicate)

Implements com.carrotsearch.hppc.LongByteAssociativeContainer.forEach, com.carrotsearch.hppc.LongByteAssociativeContainer.forEach.

Applies a given procedure to all keys-value pairs in this container.

public byte
public byte
getOrDefault(long key, byte defaultValue)

Implements com.carrotsearch.hppc.LongByteMap.getOrDefault.

public boolean
indexExists(int
The index of a given key, as returned from indexOf.
index
)

Implements com.carrotsearch.hppc.LongByteMap.indexExists.

public byte
indexGet(int
The index of an existing key.
index
)

Implements com.carrotsearch.hppc.LongByteMap.indexGet.

Returns the value associated with an existing key.

public void
indexInsert(int
The index of a previously non-existing key, as returned from indexOf.
index
,
long key, byte value)

Implements com.carrotsearch.hppc.LongByteMap.indexInsert.

Inserts a key-value pair for a key that is not present in the map.

public int
indexOf(long
The key to locate in the map.
key
)

Implements com.carrotsearch.hppc.LongByteMap.indexOf.

Returns a logical "index" of a given key that can be used to speed up follow-up value setters or getters in certain scenarios (conditional logic).

public byte
indexRemove(int
The index of the key to remove, as returned from indexOf.
index
)

Implements com.carrotsearch.hppc.LongByteMap.indexRemove.

Removes a key-value pair at an index previously acquired from indexOf.

public byte
indexReplace(int
The index of an existing key.
index
,
byte newValue)

Implements com.carrotsearch.hppc.LongByteMap.indexReplace.

Replaces the value associated with an existing key and returns any previous value stored for that key.

public boolean
public Iterator<LongByteCursor>
iterator()

Implements com.carrotsearch.hppc.LongByteAssociativeContainer.iterator.

Returns a cursor over the entries (key-value pairs) in this map.

public LongCollection
keys()

Implements com.carrotsearch.hppc.LongByteAssociativeContainer.keys.

Returns a collection of keys of this container.

public byte
put(long key, byte value)

Implements com.carrotsearch.hppc.LongByteMap.put.

Place a given key and value in the container.

public int
putAll(LongByteAssociativeContainer container)

Implements com.carrotsearch.hppc.LongByteMap.putAll.

Puts all keys from another container to this map, replacing the values of existing keys, if such keys are present.

public int
putAll(Iterable<? extends LongByteCursor> iterable)

Implements com.carrotsearch.hppc.LongByteMap.putAll.

Puts all keys from an iterable cursor to this map, replacing the values of existing keys, if such keys are present.

public byte
putOrAdd(long
The key of the value to adjust.
key
,
byte
The value to put if key does not exist.
putValue
,
byte
The value to add to the existing value if key exists.
incrementValue
)

Implements com.carrotsearch.hppc.LongByteMap.putOrAdd.

If key exists, putValue is inserted into the map, otherwise any existing value is incremented by additionValue.

private static RuntimeException
public void
release()

Implements com.carrotsearch.hppc.LongByteMap.release.

Removes all elements from the collection and additionally releases any internal buffers.

public byte
remove(long key)

Implements com.carrotsearch.hppc.LongByteMap.remove.

Remove all values at the given key.

public int
removeAll(LongContainer container)

Implements com.carrotsearch.hppc.LongByteAssociativeContainer.removeAll.

Removes all keys (and associated values) present in a given container.

public int
removeAll(LongPredicate predicate)

Implements com.carrotsearch.hppc.LongByteAssociativeContainer.removeAll.

Removes all keys (and associated values) for which the predicate returns true.

public int
removeAll(LongBytePredicate predicate)

Implements com.carrotsearch.hppc.LongByteAssociativeContainer.removeAll.

Removes all keys (and associated values) for which the predicate returns true.

public int
protected int[]
sortIterationOrder(int[] entryIndexes, LongComparator comparator)

Sort the iteration order array based on the provided comparator on the keys.

protected int[]
sortIterationOrder(int[] entryIndexes, LongByteComparator comparator)

Sort the iteration order array based on the provided comparator on keys and values.

public ByteContainer
values()

Implements com.carrotsearch.hppc.LongByteAssociativeContainer.values.

Returns a container view of all values present in this container.

public String
visualizeKeyDistribution(int
The number of characters to "squeeze" the entire buffer into.
characters
)

Implements com.carrotsearch.hppc.LongByteMap.visualizeKeyDistribution.

Visually depict the distribution of keys.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait