Package net.solarnetwork.util
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 Summary
Modifier and TypeMethodDescriptionvoidforEachOrdered(int min, int max, IntShortBiConsumer action) Iterate over a range of (int, short) tuples.voidforEachOrdered(IntShortBiConsumer action) Iterate over all primitive pairs in this collection.
-
Method Details
-
forEachOrdered
Iterate over all primitive pairs in this collection.This method of iteration can be more efficient than iterating via the
IteratorAPI because no unboxing of primitives is necessary.- Parameters:
action- the consumer to handle the (int, short) tuples
-
forEachOrdered
Iterate over a range of (int, short) tuples.This method of iteration can be more efficient than iterating via the
IteratorAPI because no unboxing of primitives is necessary. The meaning of howminandmaxare interpreted is implementation specific. For example, if the tuples in this collection represent key/value pairs, like aMap, 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
-