com.ibm.workplace.wcm.api
Interface DocumentIdIterator<T extends Document>

Type Parameters:
T - The WCM API type
All Superinterfaces:
java.util.Iterator<DocumentId<T>>

public interface DocumentIdIterator<T extends Document>
extends java.util.Iterator<DocumentId<T>>

DocumentIdIterator iterates over DocumentId objects.

All objects returned by the next() method are of type DocumentId. Note. This iterator does NOT support the remove() operation.


Method Summary
 int getCount()
          Deprecated. The value returned may not be accurate for large iterators, and may be unknown. The the following code should be used instead: while (iter.hasNext()) {count = count + 1;}
 boolean hasNext()
          Returns true if the iteration has more elements.
 DocumentId<T> next()
          Returns the next element in the iteration.
 DocumentId<T> nextId()
          Deprecated. Use next(). Since this class has been generified, the two methods are identical.
 void remove()
          This method is not implemented.
 

Method Detail

hasNext

boolean hasNext()
Returns true if the iteration has more elements. (In other words, returns true if next() would return an element rather than throwing an exception.)

Specified by:
hasNext in interface java.util.Iterator<DocumentId<T extends Document>>
Returns:
true if the iterator has more elements; false otherwise

next

DocumentId<T> next()
Returns the next element in the iteration. All objects returned from this iterator will be instances of DocumentId.

The common practice is to cast the object returned by next() to a DocumentId.

The hasNext() method should be called first to ensure there is a next element in the iteration, otherwise an exception may be thrown.

Specified by:
next in interface java.util.Iterator<DocumentId<T extends Document>>
Returns:
the next element in the iteration.
Throws:
java.util.NoSuchElementException - if the iteration has no more elements.

nextId

@Deprecated
DocumentId<T> nextId()
Deprecated. Use next(). Since this class has been generified, the two methods are identical.

Returns the next DocumentId in the iteration.

The hasNext() method should be called first to ensure there is a next element in the iteration, otherwise an exception may be thrown.

Returns:
the next DocumentId in the iteration.
Throws:
java.util.NoSuchElementException - if the iteration has no more elements.

remove

void remove()
This method is not implemented. Each call will result in an UnsupportedOperationException being thrown.

Specified by:
remove in interface java.util.Iterator<DocumentId<T extends Document>>
Throws:
java.lang.UnsupportedOperationException - each time the method is called

getCount

@Deprecated
int getCount()
Deprecated. The value returned may not be accurate for large iterators, and may be unknown. The the following code should be used instead: while (iter.hasNext()) {count = count + 1;}

Returns the number of elements in this Iterator. If this Iterator contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE. If the count is unknown, -1 will be returned.

Returns:
the number of elements in this Iterator.