Package io.jawk.ext
Interface ForInKeyOrder
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Supplies the key traversal order used by
for (index in array)
statements.
The interpreter itself has no opinion about iteration order: it snapshots
whatever collection this hook returns. Extensions that implement ordered
traversal (such as the gawk compatibility extension honoring
PROCINFO["sorted_in"]) register an instance from their
beforeStart hook. Implementations that have no ordering to apply
should return array.keySet() directly to avoid any extra copy.
-
Method Summary
-
Method Details
-
order
Returns the keys ofarrayin the orderfor (index in array)should traverse them.- Parameters:
array- associative array about to be iterated- Returns:
- the keys in traversal order; the interpreter copies the returned collection before iterating
-