Interface IntShortOrderedIterable

All Known Implementing Classes:
IntShortMap

public interface IntShortOrderedIterable
API for a collection that supports ordered iteration over (int, short) tuples.
Since:
1.58
Version:
1.0
Author:
matt
  • Method Details

    • forEachOrdered

      void forEachOrdered(IntShortBiConsumer action)
      Iterate over all primitive pairs in this collection.

      This method of iteration can be more efficient than iterating via the Iterator API because no unboxing of primitives is necessary.

      Parameters:
      action - the consumer to handle the (int, short) tuples
    • forEachOrdered

      void forEachOrdered(int min, int max, IntShortBiConsumer action)
      Iterate over a range of (int, short) tuples.

      This method of iteration can be more efficient than iterating via the Iterator API because no unboxing of primitives is necessary. The meaning of how min and max are interpreted is implementation specific. For example, if the tuples in this collection represent key/value pairs, like a Map, they might refer to map keys and provide a way to iterate over a subset of the map's data.

      Parameters:
      min - the minimum key value (inclusive)
      max - the maximum key value (exclusive)
      action - the consumer to handle the (int, short) tuples