Interface IntByteAssociativeContainer

All Superinterfaces:
Iterable<IntByteCursor>
All Known Subinterfaces:
IntByteMap
All Known Implementing Classes:
IntByteHashMap, IntByteScatterMap

@Generated(date="2024-02-21T00:00:00+0000", value="KTypeVTypeAssociativeContainer.java") public interface IntByteAssociativeContainer extends Iterable<IntByteCursor>
An associative container from keys to (one or possibly more) values.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    containsKey(int key)
    Returns true if this container has an association to a value for the given key.
    <T extends IntByteProcedure>
    T
    forEach(T procedure)
    Applies a given procedure to all keys-value pairs in this container.
    boolean
     
    Returns a cursor over the entries (key-value pairs) in this map.
    Returns a collection of keys of this container.
    int
    Removes all keys (and associated values) present in a given container.
    int
    Removes all keys (and associated values) for which the predicate returns true.
    int
    Removes all keys (and associated values) for which the predicate returns true.
    int
     
    Returns a container view of all values present in this container.

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Method Details

    • iterator

      Iterator<IntByteCursor> 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 Iterable<IntByteCursor>
    • containsKey

      boolean containsKey(int 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(IntContainer 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(IntPredicate predicate)
      Removes all keys (and associated values) for which the predicate returns true.
      Returns:
      Returns the number of elements actually removed as a result of this call.
    • removeAll

      int removeAll(IntBytePredicate predicate)
      Removes all keys (and associated values) for which the predicate returns true.
      Returns:
      Returns the number of elements actually removed as a result of this call.
    • forEach

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

      <T extends IntBytePredicate> T forEach(T predicate)
      Applies a given predicate to all keys-value pairs in this container. Returns the argument (any subclass of IntBytePredicate. 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. The iteration is continued as long as the predicate returns true.
    • 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

      ByteContainer 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.