com.carrotsearch.hppc
Interface LongCharAssociativeContainer

All Superinterfaces:
java.lang.Iterable<LongCharCursor>
All Known Subinterfaces:
LongCharMap
All Known Implementing Classes:
LongCharOpenHashMap

@Generated(date="2011-07-12T16:58:51+0200",
           value="HPPC generated from: LongCharAssociativeContainer.java")
public interface LongCharAssociativeContainer
extends java.lang.Iterable<LongCharCursor>

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

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

See Also:
LongContainer

Method Summary
 void clear()
          Clear all keys and values in the container.
 boolean containsKey(long key)
          Returns true if this container has an association to a value for the given key.
<T extends LongCharProcedure>
T
forEach(T procedure)
          Applies a given procedure to all keys-value pairs in this container.
 boolean isEmpty()
           
 java.util.Iterator<LongCharCursor> iterator()
          Returns a cursor over the entries (key-value pairs) in this map.
 LongCollection keys()
          Returns a collection of keys of this container.
 int removeAll(LongContainer container)
          Removes all keys (and associated values) present in a given container.
 int removeAll(LongPredicate predicate)
          Removes all keys (and associated values) for which the predicate returns true.
 int size()
           
 CharContainer values()
          Returns a container view of all values present in this container.
 

Method Detail

iterator

java.util.Iterator<LongCharCursor> iterator()
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 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.

Specified by:
iterator in interface java.lang.Iterable<LongCharCursor>

containsKey

boolean containsKey(long key)
Returns true if this container has an association to a value for the given key.


size

int size()
Returns:
Returns the current size (number of assigned keys) in the container.

isEmpty

boolean isEmpty()
Returns:
Return true if this hash map contains no assigned keys.

removeAll

int removeAll(LongContainer container)
Removes all keys (and associated values) present in a given container. An alias to:
 keys().removeAll(container)
 
but with no additional overhead.

Returns:
Returns the number of elements actually removed as a result of this call.

removeAll

int removeAll(LongPredicate predicate)
Removes all keys (and associated values) for which the predicate returns true. An alias to:
 keys().removeAll(container)
 
but with no additional overhead.

Returns:
Returns the number of elements actually removed as a result of this call.

forEach

<T extends LongCharProcedure> T forEach(T procedure)
Applies a given procedure to all keys-value pairs in this container. Returns the argument (any subclass of LongCharProcedure. 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.


clear

void clear()
Clear all keys and values in the container.


keys

LongCollection keys()
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.


values

CharContainer values()
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.



Copyright © 2011 Carrot Search s.c.. All Rights Reserved.