joeq.Compiler.Quad
Class ExceptionHandlerIterator

java.lang.Object
  extended by joeq.Compiler.Quad.ExceptionHandlerIterator
All Implemented Interfaces:
Iterator, ListIterator, ListIterator.ExceptionHandler

public class ExceptionHandlerIterator
extends Object
implements ListIterator.ExceptionHandler

Iterator for iterating through exception handlers. Compatible with ListIterator.

Version:
$Id: ExceptionHandlerIterator.java 1931 2004-09-22 22:17:47Z joewhaley $
Author:
John Whaley
See Also:
ListIterator, ExceptionHandler

Field Summary
static ExceptionHandlerIterator EMPTY
          The empty basic block iterator.
 
Constructor Summary
ExceptionHandlerIterator(ExceptionHandlerList ehs)
          Creates new ExceptionHandlerIterator.
 
Method Summary
 void add(Object o)
          Throws UnsupportedOperationException.
static ExceptionHandlerIterator getEmptyIterator()
          Return an empty, unmodifiable iterator.
 boolean hasNext()
          Returns true if this iterator has a next element.
 boolean hasPrevious()
          Returns true if this iterator has a previous element.
 Object next()
          Returns the next element of this iterator.
 ExceptionHandler nextExceptionHandler()
          Returns the next element of this iterator, avoiding the cast.
 int nextIndex()
          Returns the index of the next element of this iterator.
 Object previous()
          Returns the previous element of this iterator.
 ExceptionHandler previousExceptionHandler()
          Returns the previous element of this iterator, avoiding the cast.
 int previousIndex()
          Returns the index of the previous element of this iterator.
 void remove()
          Throws UnsupportedOperationException.
 void set(Object o)
          Throws UnsupportedOperationException.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY

public static final ExceptionHandlerIterator EMPTY
The empty basic block iterator. Immutable.

Constructor Detail

ExceptionHandlerIterator

public ExceptionHandlerIterator(ExceptionHandlerList ehs)
Creates new ExceptionHandlerIterator.

Parameters:
ehs - list of exception handlers to iterate through.
Method Detail

hasNext

public boolean hasNext()
Returns true if this iterator has a next element.

Specified by:
hasNext in interface Iterator
Specified by:
hasNext in interface ListIterator
Returns:
true if this iterator has a next element.

next

public Object next()
Returns the next element of this iterator. Use nextExceptionHandler to avoid the cast.

Specified by:
next in interface Iterator
Specified by:
next in interface ListIterator
Returns:
the next element of this iterator.
See Also:
nextExceptionHandler()

nextExceptionHandler

public ExceptionHandler nextExceptionHandler()
Returns the next element of this iterator, avoiding the cast.

Specified by:
nextExceptionHandler in interface ListIterator.ExceptionHandler
Returns:
the next element of this iterator.
See Also:
next()

nextIndex

public int nextIndex()
Returns the index of the next element of this iterator.

Specified by:
nextIndex in interface ListIterator
Returns:
the index of the next element of this iterator.

hasPrevious

public boolean hasPrevious()
Returns true if this iterator has a previous element.

Specified by:
hasPrevious in interface ListIterator
Returns:
true if this iterator has a previous element.

previous

public Object previous()
Returns the previous element of this iterator. Use previousExceptionHandler to avoid the cast.

Specified by:
previous in interface ListIterator
Returns:
the previous element of this iterator.
See Also:
previousExceptionHandler()

previousExceptionHandler

public ExceptionHandler previousExceptionHandler()
Returns the previous element of this iterator, avoiding the cast.

Specified by:
previousExceptionHandler in interface ListIterator.ExceptionHandler
Returns:
the previous element of this iterator.
See Also:
previous()

previousIndex

public int previousIndex()
Returns the index of the previous element of this iterator.

Specified by:
previousIndex in interface ListIterator
Returns:
the index of the previous element of this iterator.

remove

public void remove()
Throws UnsupportedOperationException. (Removing is not supported.)

Specified by:
remove in interface Iterator
Specified by:
remove in interface ListIterator
Throws:
UnsupportedOperationException - always

set

public void set(Object o)
Throws UnsupportedOperationException. (Setting is not supported.)

Specified by:
set in interface ListIterator
Throws:
UnsupportedOperationException - always

add

public void add(Object o)
Throws UnsupportedOperationException. (Adding is not supported.)

Specified by:
add in interface ListIterator
Throws:
UnsupportedOperationException - always

getEmptyIterator

public static ExceptionHandlerIterator getEmptyIterator()
Return an empty, unmodifiable iterator.

Returns:
an empty, unmodifiable iterator


Copyright © 2001-2008 John Whaley. All Rights Reserved.