public class MessageIterator extends Object implements Iterator<Message>
Message objects within an Event
MessageIterator objects are used to process the individual Message objects
in an Event received in an EventHandler, from
EventQueue.nextEvent() or from AbstractSession.nextEvent().
This class is used to iterate over each message in an Event.
You can use the MessageIterator as follows
MessageIterator msgIter = event.messageIterator();
while (msgIter.hasNext()) {
Message msg = msgIter.next();
...
}
public Message next()
Return the next element in the iteration and Attempts to advance this
MessageIterator to the next Message in this Event
next in interface Iterator<Message>Message in the iterationNoSuchElementException - if the iteration has no more elementspublic boolean hasNext()
(In other words, returns true if next() would return an element
rather than throwing an exception.)
Copyright © 2017 Bloomberg L.P.. All rights reserved.