com.vladium.jcd.cls
Class ConstantCollection.ConstantIterator

java.lang.Object
  extended by com.vladium.jcd.cls.ConstantCollection.ConstantIterator
All Implemented Interfaces:
IConstantCollection.IConstantIterator
Enclosing class:
ConstantCollection

private static final class ConstantCollection.ConstantIterator
extends java.lang.Object
implements IConstantCollection.IConstantIterator


Field Summary
private  java.util.List m_constants
           
private  int m_index
           
private  int m_next_index
           
private  int m_prev_index
           
 
Constructor Summary
ConstantCollection.ConstantIterator(java.util.List constants)
           
 
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.
private  void shift()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_index

private int m_index

m_prev_index

private int m_prev_index

m_next_index

private int m_next_index

m_constants

private java.util.List m_constants
Constructor Detail

ConstantCollection.ConstantIterator

ConstantCollection.ConstantIterator(java.util.List constants)
Method Detail

nextIndex

public int nextIndex()
Description copied from interface: IConstantCollection.IConstantIterator
Returns the next entry slot index.

Specified by:
nextIndex in interface IConstantCollection.IConstantIterator
Returns:
int next valid slot index [always positive for a valid slot; -1 when the enumeration is exhausted]

nextConstant

public CONSTANT_info nextConstant()
Description copied from interface: IConstantCollection.IConstantIterator
Returns the next entry. This is a convenience method for doing get(nextIndex()) and avoiding index bound violation exceptions.

Specified by:
nextConstant in interface IConstantCollection.IConstantIterator
Returns:
CONSTANT_info next valid entry [null when the enumeration is exhausted]

set

public CONSTANT_info set(CONSTANT_info constant)
Description copied from interface: IConstantCollection.IConstantIterator
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.

Specified by:
set in interface IConstantCollection.IConstantIterator

shift

private void shift()