JXTA

net.jxta.endpoint
Class Message.ElementIterator

java.lang.Object
  extended by net.jxta.endpoint.Message.ElementIterator
All Implemented Interfaces:
Iterator<MessageElement>, ListIterator<MessageElement>
Enclosing class:
Message

public class Message.ElementIterator
extends Object
implements ListIterator<MessageElement>

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 Iterator 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(MessageElement obj)
          

Not provided because the namespace cannot be specified.

 String getNamespace()
          return the namespace of the current element.
 MessageElement getSignature()
          Return the signature element of the current element.
 boolean hasNext()
          
 boolean hasPrevious()
          
 MessageElement next()
          
 int nextIndex()
          
 MessageElement previous()
          
 int previousIndex()
          
 void remove()
          
 void set(MessageElement 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 Iterator<MessageElement>
Specified by:
hasNext in interface ListIterator<MessageElement>

next

public MessageElement next()

Specified by:
next in interface Iterator<MessageElement>
Specified by:
next in interface ListIterator<MessageElement>

nextIndex

public int nextIndex()

Specified by:
nextIndex in interface ListIterator<MessageElement>

hasPrevious

public boolean hasPrevious()

Specified by:
hasPrevious in interface ListIterator<MessageElement>

previous

public MessageElement previous()

Specified by:
previous in interface ListIterator<MessageElement>

previousIndex

public int previousIndex()

Specified by:
previousIndex in interface ListIterator<MessageElement>

add

public void add(MessageElement obj)

Not provided because the namespace cannot be specified.

Specified by:
add in interface ListIterator<MessageElement>

remove

public void remove()

Specified by:
remove in interface Iterator<MessageElement>
Specified by:
remove in interface ListIterator<MessageElement>

set

public void set(MessageElement obj)

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

Specified by:
set in interface ListIterator<MessageElement>

getNamespace

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

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

getSignature

public MessageElement getSignature()
Return the signature element of the current element.

Returns:
The signature element of the current element.

JXSE