public interface IntCharCursor extends Cursor
int
keys and
char
values.
See the comparison of iteration ways in the library.
IntCharCursors
of immutable maps don't support setValue(char)
operation. More about mutability profiles.
IntCharMap.cursor()
Modifier and Type | Method and Description |
---|---|
void |
forEachForward(IntCharConsumer action)
Performs the given action for each entry of the iteration after the cursor in forward
direction until all entries have been processed or the action throws an exception.
|
int |
key()
Returns the key of the entry to which the cursor currently points.
|
void |
setValue(char value)
Replaces the value of the entry to which the cursor currently points (optional operation).
|
char |
value()
Returns the value of the entry to which the cursor currently points.
|
void forEachForward(@Nonnull IntCharConsumer action)
cur.forEachForward(action)
is exact equivalent of
while (cur.moveNext())
action.accept(cur.key(), cur.value());
action
- the action to be performed for each entryint key()
Throws IllegalStateException
, if the cursor isn't pointing to any entry: if it
is in front of the first entry, after the last, or the current entry has been removed
using Cursor.remove()
operation.
IllegalStateException
- if this cursor is initially in front of the first entry
and Cursor.moveNext()
hasn't been called yet,
or the previous call of moveNext
returned false
,
or remove()
has been performed after the previous cursor movementchar value()
Throws IllegalStateException
, if the cursor isn't pointing to any entry: if it
is in front of the first entry, after the last, or the current entry has been removed
using Cursor.remove()
operation.
IllegalStateException
- if this cursor is initially in front of the first entry
and Cursor.moveNext()
hasn't been called yet,
or the previous call of moveNext
returned false
,
or remove()
has been performed after the previous cursor movementvoid setValue(char value)
Throws IllegalStateException
if the cursor isn't pointing to any entry: if it
is in front of the first entry, after the last, or the current entry has been removed
using Cursor.remove()
operation.
value
- new value to be stored in the entry to which the cursor currently pointsUnsupportedOperationException
- if the setValue
operation is not supported
by this cursorIllegalArgumentException
- if some property this value prevents it from being stored
in the entries of the iterationIllegalStateException
- if this cursor is initially in front of the first entry
and Cursor.moveNext()
hasn't been called yet,
or the previous call of moveNext
returned false
,
or remove()
has been performed after the previous cursor movement