com.carrotsearch.hppcrt.ShortObjectMap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hppcrt Show documentation
Show all versions of hppcrt Show documentation
High Performance Primitive Collections Realtime
(fork of HPPC of Carrotsearch)
Fundamental data structures (maps, sets, lists, stacks, queues, heaps, sorts) generated for
combinations of object and primitive types to conserve JVM memory and speed
up execution. The Realtime fork intend of extending collections while tweaking and optimizations to remove any dynamic allocations at runtime,
and low variance execution times.
package com.carrotsearch.hppcrt;
import com.carrotsearch.hppcrt.cursors.ShortObjectCursor;
/**
* An associative container with unique binding from keys to a single value.
*/
@javax.annotation.Generated(date = "2015-02-27T19:21:18+0100", value = "HPPC-RT generated from: ShortObjectMap.java")
public interface ShortObjectMap
extends ShortObjectAssociativeContainer
{
/**
* Place a given key and value in the container.
* @return Returns the value previously stored under the given key in the map if an equal key is part of the map, and replaces the existing
* value only with the argument value. If no previous key existed,
* the default value is returned and the (key, value) pair is inserted.
*/
VType put(short key, VType value);
/**
* Trove-inspired API method. An equivalent
* of the following code:
*
* if (!map.containsKey(key))
* map.put(key, value);
*
*
* @param key The key of the value to check.
* @param value The value to put if key
does not exist.
* @return true
if key
did not exist and value
* was placed in the map.
*/
boolean putIfAbsent(final short key, final VType value);
/**
* @return Returns the value associated with the given key or the default value
* for the value type, if the key is not associated with any value.
*
*/
VType get(short key);
/**
* Puts all keys from another container to this map, replacing the values
* of existing keys, if such keys are present.
*
* @return Returns the number of keys added to the map as a result of this
* call (not previously present in the map). Values of existing keys are overwritten.
*/
int putAll(ShortObjectAssociativeContainer extends VType> container);
/**
* Puts all keys from an iterable cursor to this map, replacing the values
* of existing keys, if such keys are present.
*
* @return Returns the number of keys added to the map as a result of this
* call (not previously present in the map). Values of existing keys are overwritten.
*/
int putAll(Iterable extends ShortObjectCursor extends VType>> iterable);
/**
* Remove all values at the given key. The default value for the key type is returned
* if the value does not exist in the map.
*/
VType remove(short key);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy