Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum
Class ForumThreadIterator

java.lang.Object
  extended by com.jivesoftware.forum.ForumThreadIterator
All Implemented Interfaces:
java.util.Iterator
Direct Known Subclasses:
ForumThreadBlockIterator, ForumThreadIteratorProxy

public abstract class ForumThreadIterator
extends java.lang.Object
implements java.util.Iterator

An iterator for ForumThreads that allows backwards and forwards iteration, as well as setting an index into the Iteration.


Field Summary
static ForumThreadIterator EMPTY_ITERATOR
          The empty thread iterator.
 
Constructor Summary
ForumThreadIterator()
           
 
Method Summary
abstract  boolean hasNext()
          Returns true if this iterator has more threads when traversing the list in the forward direction.
abstract  boolean hasPrevious()
          Returns true if this list iterator has more threads when traversing the list in the reverse direction.
abstract  java.lang.Object next()
          Returns the next thread in the list.
abstract  java.lang.Object previous()
          Returns the previous element in the list.
 void remove()
          This method of the Iterator interface is not supported due to security considerations.
abstract  void setIndex(ForumThread thread)
          Sets the index for the iteration to the specified ForumThread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_ITERATOR

public static final ForumThreadIterator EMPTY_ITERATOR
The empty thread iterator.

Constructor Detail

ForumThreadIterator

public ForumThreadIterator()
Method Detail

hasNext

public abstract boolean hasNext()
Returns true if this iterator has more threads when traversing the list in the forward direction. (In other words, returns true if next would return a thread rather than throwing an exception.)

Specified by:
hasNext in interface java.util.Iterator
Returns:
true if the iterator has more threads when traversing the list in the forward direction.

next

public abstract java.lang.Object next()
Returns the next thread in the list. This method may be called repeatedly to iterate through the list, or intermixed with calls to previous to go back and forth. (Note that alternating calls to next and previous will return the same element repeatedly.)

Specified by:
next in interface java.util.Iterator
Returns:
the next thread in the list.
Throws:
java.util.NoSuchElementException - if the iteration has no next element.

hasPrevious

public abstract boolean hasPrevious()
Returns true if this list iterator has more threads when traversing the list in the reverse direction. (In other words, returns true if previous would return a thread rather than throwing an exception.)

Returns:
true if the list iterator has more elements when traversing the list in the reverse direction.

previous

public abstract java.lang.Object previous()
Returns the previous element in the list. This method may be called repeatedly to iterate through the list backwards, or intermixed with calls to next to go back and forth. (Note that alternating calls to next and previous will return the same element repeatedly.)

Returns:
the previous element in the list.
Throws:
java.util.NoSuchElementException - if the iteration has no previous element.

setIndex

public abstract void setIndex(ForumThread thread)
Sets the index for the iteration to the specified ForumThread.

Implementation note: a performance setting allows an optional short-term cache so that object invalidations are delayed for a period of time. This can mean that trying to set the index for a newly created thread can fail. Ensure that this performance setting is disabled, or refrain from calling this method with newly created threads.

Throws:
java.util.NoSuchElementException - if thread is not a valid element of the iteration.

remove

public void remove()
This method of the Iterator interface is not supported due to security considerations. Calling it will always result in an an exception being thrown.

Specified by:
remove in interface java.util.Iterator
Throws:
java.lang.UnsupportedOperationException - if this method is called.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.