com.ibm.mq.jms
Class MQQueueEnumeration

java.lang.Object
  |
  +--com.ibm.mq.jms.MQQueueEnumeration
All Implemented Interfaces:
java.util.Enumeration

public class MQQueueEnumeration
extends java.lang.Object
implements java.util.Enumeration

MQQueueEnumeration enumerates messages on a queue. This class is not defined in the JMS specification; it is created by calling the getEnumeration method of MQQueueBrowser. The class contains a base MQQueue instance to hold the browse cursor. The queue is closed once the cursor has moved off the end of the queue. There is no way to reset an instance of this class; it acts as a one-shot mechanism.

See Also:
MQQueueBrowser

Method Summary
 MQQueue getQueue()
          Gets the queue being browsed.
 boolean hasMoreElements()
          Indicates whether another message can be returned.
 java.lang.Object nextElement()
          Gets the current message.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasMoreElements

public boolean hasMoreElements()
Indicates whether another message can be returned.

Specified by:
hasMoreElements in interface java.util.Enumeration
Returns:
true if another message can be returned.

nextElement

public java.lang.Object nextElement()
                             throws java.util.NoSuchElementException
Gets the current message. Always returns a message if hasMoreElements returns true. It is possible for the returned message to pass its expiry date between the hasMoreElements() and the nextElement() calls.

Specified by:
nextElement in interface java.util.Enumeration
Returns:
the current message.
Throws:
java.util.NoSuchElementException

getQueue

public MQQueue getQueue()
Gets the queue being browsed.

Returns:
the current queue.

(c) Copyright IBM Corp. 2005. All Rights Reserved.