com.vladium.jcd.cls
Interface IConstantCollection.IConstantIterator

All Known Implementing Classes:
ConstantCollection.ConstantIterator
Enclosing interface:
IConstantCollection

public static interface IConstantCollection.IConstantIterator

A custom fail-fast iterator class returned by IConstantCollection.iterator(). It allows iterating over all entries in a way that steps over all 'invalid' inner slots (extra slots consumed by CONSTANT_Long and CONSTANT_Double entries).


Method Summary
 CONSTANT_info nextConstant()
          Returns the next entry.
 int nextIndex()
          Returns the next entry slot index.
 CONSTANT_info set(CONSTANT_info constant)
          A convenience method that is equivalent to IConstantCollection.set(int, com.vladium.jcd.cls.constant.CONSTANT_info) and replaces the entry that was visited last without invalidating the iterator.
 

Method Detail

nextIndex

int nextIndex()
Returns the next entry slot index.

Returns:
int next valid slot index [always positive for a valid slot; -1 when the enumeration is exhausted]

nextConstant

CONSTANT_info nextConstant()
Returns the next entry. This is a convenience method for doing get(nextIndex()) and avoiding index bound violation exceptions.

Returns:
CONSTANT_info next valid entry [null when the enumeration is exhausted]

set

CONSTANT_info set(CONSTANT_info constant)
A convenience method that is equivalent to IConstantCollection.set(int, com.vladium.jcd.cls.constant.CONSTANT_info) and replaces the entry that was visited last without invalidating the iterator.