Oracle Collaboration Suite Discussions Java API Reference
10g (10.1.1)

Part No. B16232-01


oracle.discussions.sdk
Interface TdIterator

All Superinterfaces:
java.util.Iterator

public interface TdIterator
extends java.util.Iterator

Parent interface for all oracle discussion related iterators Extends java.util.Iterator. Provides two way access to the underlying collection and also a search method which takes in the key and returns corresponding position of the key in the collection.

Sample code snippet illustrating the usage of TdIterator.

  String rfc822Id = tdMsg.getRfc822MessageId();
  TdThread    tdt = tdMsg.getThread();//tdMsg is a TdMessage Object
  TdIterator tdit = tdt.getMessages();
  
Since:
OCS 10.1.1

Method Summary
int find(java.lang.Object key)
Returns the index of object with the given key in the iterator
boolean hasPrevious()
Returns a boolean value indicating if there is an object before the current iterator position in the underlying collection.
java.lang.Object previous()
Returns an object which is before the current iterator position in the underlying collection.
void seek(int iPosition)
Moves the iterator to the specified position in the underlying collection.
int size()
Returns the number of objects in the underlying collection.

Methods inherited from interface java.util.Iterator
hasNext, next, remove

Method Detail

hasPrevious

public boolean hasPrevious()
Returns a boolean value indicating if there is an object before the current iterator position in the underlying collection.
Returns:
boolean

previous

public java.lang.Object previous()
Returns an object which is before the current iterator position in the underlying collection.
Returns:
Object

size

public int size()
         throws TdException
Returns the number of objects in the underlying collection.
Returns:
int
Throws:
TdException - a generic oracle discussions exception

seek

public void seek(int iPosition)
          throws TdException
Moves the iterator to the specified position in the underlying collection. Can be used when the objects in the underlying collection are accessed randomly.
Parameters:
iPosition - the position to which the iterator is to be moved.
Throws:
TdException - a generic oracle discussions exception

find

public int find(java.lang.Object key)
         throws TdException
Returns the index of object with the given key in the iterator
Parameters:
key - the Object which is being searched in the underlying collection
Throws:
TdException - a generic oracle discussions exception

Copyright © 2005, Oracle. All rights reserved.