com.bloomberglp.blpapi
Class MessageIterator

java.lang.Object
  extended by com.bloomberglp.blpapi.MessageIterator
All Implemented Interfaces:
java.util.Iterator<Message>

public class MessageIterator
extends java.lang.Object
implements java.util.Iterator<Message>

An iterator over the 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();
         ...
     }
 

Author:
Siva Somu (ssomu)

Method Summary
 boolean hasNext()
          Returns true if the iteration has more elements.
 Message next()
          Return the next element in the iteration
 void remove()
          The remove operation is not supported by this Iterator
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

next

public Message next()
Return the next element in the iteration

Return the next element in the iteration and Attempts to advance this MessageIterator to the next Message in this Event

Specified by:
next in interface java.util.Iterator<Message>
Returns:
the next Message in the iteration
Throws:
java.util.NoSuchElementException - if the iteration has no more elements

hasNext

public 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<Message>
Returns:
true if the iterator has more elements

remove

public void remove()
The remove operation is not supported by this Iterator

Specified by:
remove in interface java.util.Iterator<Message>
Throws:
always - throws UnsupportedOperationException.


Copyright © 2015 Bloomberg L.P.. All Rights Reserved.