All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.carrotsearch.hppcrt.maps.CharFloatMap Maven / Gradle / Ivy

package com.carrotsearch.hppcrt.maps;

import com.carrotsearch.hppcrt.CharFloatAssociativeContainer;
import com.carrotsearch.hppcrt.cursors.CharFloatCursor;

/**
 * An associative container with unique binding from keys to a single value.
 */
  
 @javax.annotation.Generated(date = "2014-08-19T19:56:32+0200", value = "HPPC-RT generated from: CharFloatMap.java") 
public interface CharFloatMap
extends CharFloatAssociativeContainer
{
    /**
     * 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.
     */
    float put(char key, float 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 char key, final float value); /** * An equivalent of calling *
     *  putOrAdd(key, additionValue, additionValue);
     * 
* * @param key The key of the value to adjust. * @param additionValue The value to put or add to the existing value if key exists. * @return Returns the current value associated with key (after changes). */ float addTo(char key, float additionValue); /** * Trove-inspired API method. A logical * equivalent of the following code (but does not update {@link #lastSlot): *
     *  if (containsKey(key))
     *  {
     *      float v = (float) (lget() + additionValue);
     *      lset(v);
     *      return v;
     *  }
     *  else
     *  {
     *     put(key, putValue);
     *     return putValue;
     *  }
     * 
* * @param key The key of the value to adjust. * @param putValue The value to put if key does not exist. * @param additionValue The value to add to the existing value if key exists. * @return Returns the current value associated with key (after changes). */ float putOrAdd(char key, float putValue, float additionValue); /** * @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. * */ float get(char 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(CharFloatAssociativeContainer 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 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. */ float remove(char key); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy