Project JXTA

net.jxta.endpoint
Class Message.ElementIterator

java.lang.Object
  extended bynet.jxta.endpoint.Message.ElementIterator
All Implemented Interfaces:
Iterator, ListIterator
Enclosing class:
Message

public class Message.ElementIterator
extends Object
implements ListIterator

A ListIterator for MessageElements which also provides the ability to determine the namespace of the current message element. Message Elements are iterated in the order in which they were added to the Message.

This ListIterator returned is not synchronized with the message. If you modify the state of the Message, the iterator will throw ConcurrentModificationException when next() or previous() is called.


Method Summary
 void add(Object obj)
          

Not provided because the namespace cannot be specified.

 String getNamespace()
          return the namespace of the current element.
 boolean hasNext()
          
 boolean hasPrevious()
          
 Object next()
          
 int nextIndex()
          
 Object previous()
          
 int previousIndex()
          
 void remove()
          
 void set(Object obj)
          

Replacement MessageElement will be in the same name space as the replaced element.

 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasNext

public boolean hasNext()

Specified by:
hasNext in interface ListIterator

next

public Object next()

Specified by:
next in interface ListIterator

nextIndex

public int nextIndex()

Specified by:
nextIndex in interface ListIterator

hasPrevious

public boolean hasPrevious()

Specified by:
hasPrevious in interface ListIterator

previous

public Object previous()

Specified by:
previous in interface ListIterator

previousIndex

public int previousIndex()

Specified by:
previousIndex in interface ListIterator

add

public void add(Object obj)

Not provided because the namespace cannot be specified.

Specified by:
add in interface ListIterator

remove

public void remove()

Specified by:
remove in interface ListIterator

set

public void set(Object obj)

Replacement MessageElement will be in the same name space as the replaced element.

Specified by:
set in interface ListIterator

getNamespace

public String getNamespace()
return the namespace of the current element.

Returns:
String containing the name space of the current element.

JXTA J2SE