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

com.carrotsearch.hppcrt.DoubleBooleanAssociativeContainer Maven / Gradle / Ivy

Go to download

High Performance Primitive Collections Realtime (fork of HPPC from Carrotsearch) Fundamental data structures (maps, sets, lists, queues, heaps, sorts) generated for combinations of object and primitive types to conserve JVM memory and speed up execution. The Realtime fork intends to extend the existing collections, by tweaking to remove any dynamic allocations at runtime, and to obtain low variance execution times whatever the input nature.

There is a newer version: 0.7.5
Show newest version
package com.carrotsearch.hppcrt;

import java.util.Iterator;

import com.carrotsearch.hppcrt.cursors.*;
import com.carrotsearch.hppcrt.predicates.*;
import com.carrotsearch.hppcrt.procedures.*;

/**
 * An associative container (alias: map, dictionary) from keys to (one or possibly more) values.
 * Object keys must fulfill the contract of {@link Object#hashCode()} and {@link Object#equals(Object)}.
 * 
 * 

Note that certain associative containers (like multimaps) may return the same key-value pair * multiple times from iterators.

* * @see DoubleContainer */ @javax.annotation.Generated(date = "2014-10-25T20:54:14+0200", value = "HPPC-RT generated from: DoubleBooleanAssociativeContainer.java") public interface DoubleBooleanAssociativeContainer extends Iterable { /** * Returns a cursor over the entries (key-value pairs) in this map. The iterator is * implemented as a cursor and it returns the same cursor instance on every * call to {@link Iterator#next()}. To read the current key and value use the cursor's * public fields. An example is shown below. *
     * for (IntShortCursor c : intShortMap)
     * {
     *     System.out.println("index=" + c.index
     *       + " key=" + c.key
     *       + " value=" + c.value);
     * }
     * 
* *

The index field inside the cursor gives the internal index inside * the container's implementation. The interpretation of this index depends on * to the container. */ @Override Iterator iterator(); /** * Returns true if this container has an association to a value for * the given key. */ boolean containsKey(double key); /** * @return Returns the current size (number of assigned keys) in the container. */ int size(); /** * Return the maximum number of keys this container is guaranteed to hold without reallocating. * The time for calculating the container's capacity may take O(n) time. */ int capacity(); /** * @return Return true if this hash map contains no assigned keys. */ boolean isEmpty(); /** * Removes all keys (and associated values) present in a given container. An alias to: *

     * keys().removeAll(container)
     * 
* but with no additional overhead. * * @return Returns the number of elements actually removed as a result of this call. */ int removeAll(DoubleContainer container); /** * Removes all keys (and associated values) for which the predicate returns true. * An alias to: *
     * keys().removeAll(container)
     * 
* but with no additional overhead. * * @return Returns the number of elements actually removed as a result of this call. */ int removeAll(DoublePredicate predicate); /** * Applies a given procedure to all keys-value pairs in this container. Returns the argument (any * subclass of {@link DoubleBooleanProcedure}. This lets the caller to call methods of the argument * by chaining the call (even if the argument is an anonymous type) to retrieve computed values, * for example. */ T forEach(T procedure); /** * Applies a predicate to container elements, as long as the predicate * returns true. The iteration is interrupted otherwise. * Returns the argument (any * subclass of {@link DoubleBooleanPredicate}. This lets the caller to call methods of the argument * by chaining the call (even if the argument is an anonymous type) to retrieve computed values, * for example. */ T forEach(T predicate); /** * Clear all keys and values in the container. */ void clear(); /** * Returns a collection of keys of this container. The returned collection is a view * over the key set and any modifications (if allowed) introduced to the collection will * propagate to the associative container immediately. */ DoubleCollection keys(); /** * Returns a container view of all values present in this container. The returned collection is a view * over the key set and any modifications (if allowed) introduced to the collection will * propagate to the associative container immediately. */ BooleanContainer values(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy