public interface TFloatObjectIterator<V> extends TAdvancingIterator
// accessing keys/values through an iterator: for ( TFloatObjectIterator it = map.iterator(); it.hasNext(); ) { it.advance(); if ( satisfiesCondition( it.key() ) ) { doSomethingWithValue( it.value() ); } }
// modifying values in-place through iteration: for ( TFloatObjectIterator it = map.iterator(); it.hasNext(); ) { it.advance(); if ( satisfiesCondition( it.key() ) ) { it.setValue( newValueForKey( it.key() ) ); } }
// deleting entries during iteration: for ( TFloatObjectIterator it = map.iterator(); it.hasNext(); ) { it.advance(); if ( satisfiesCondition( it.key() ) ) { it.remove(); } }
// faster iteration by avoiding hasNext(): TFloatObjectIterator iterator = map.iterator(); for ( int i = map.size(); i-- > 0; ) { iterator.advance(); doSomethingWithKeyAndValue( iterator.key(), iterator.value() ); }
Modifier and Type | Method and Description |
---|---|
float |
key()
Provides access to the key of the mapping at the iterator's position.
|
V |
setValue(V val)
Replace the value of the mapping at the iterator's position with the
specified value.
|
V |
value()
Provides access to the value of the mapping at the iterator's position.
|
advance
float key()
V value()