com.ibm.workplace.wcm.api
Interface ContentComponentIterator

All Superinterfaces:
java.util.Iterator<ContentComponent>

public interface ContentComponentIterator
extends java.util.Iterator<ContentComponent>

ContentComponentIterator, as the name suggests, iterates over ContentComponent objects in a ContentComponentContainer.

note: since v6.0.0, a ContentComponent is referred to as an "Element" in the Authoring UI.

A ContentComponentIterator is only valid for objects that can contain ContentComponents - Content, Site and SiteArea.

All objects returned by the next() method are of type ContentComponent.

Note: This class does NOT support the remove() operation.


Method Summary
 int getCount()
          Deprecated. Please use the following code instead. while (iter.hasNext()) count = count + 1;
 boolean hasNext()
          Returns true if the iteration has more elements.
 ContentComponent next()
          Returns the next element in the interation.
 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<ContentComponent>
Returns:
true if the iterator has more elements; false otherwise

next

ContentComponent next()
Returns the next element in the interation. All objects returned from this iterator will be instances of ContentComponent.

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

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<ContentComponent>
Returns:
the next element 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<ContentComponent>
Throws:
java.lang.UnsupportedOperationException - each time the method is called

getCount

int getCount()
Deprecated. Please use the following code 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.

Returns:
the number of elements in this Iterator.