activemq-cpp-3.4.0
|
Defines a 'Double ended Queue' interface that allows for insertion and removal of elements from both ends. More...
#include <src/main/decaf/util/Deque.h>
Public Member Functions | |
virtual | ~Deque () |
virtual void | addFirst (const E &element)=0 |
Inserts an element onto the front of the Deque if possible without violating the implementations capacity restrictions. | |
virtual void | addLast (const E &element)=0 |
Inserts an element onto the end of the Deque if possible without violating the implementations capacity restrictions. | |
virtual bool | offerFirst (const E &element)=0 |
This method attempts to insert the given element into the Deque at the front end. | |
virtual bool | offerLast (const E &element)=0 |
This method attempts to insert the given element into the Deque at the end. | |
virtual E | removeFirst ()=0 |
Removes the topmost element from the Deque and returns it. | |
virtual E | removeLast ()=0 |
Removes the last element from the Deque and returns it. | |
virtual bool | pollFirst (E &element)=0 |
Removes the first element from the Deque assigns it to the element reference passed. | |
virtual bool | pollLast (E &element)=0 |
Removes the last element from the Deque assigns it to the element reference passed. | |
virtual E & | getFirst ()=0 |
Attempts to fetch a reference to the first element in the Deque. | |
virtual const E & | getFirst () const =0 |
virtual E & | getLast ()=0 |
Attempts to fetch a reference to the last element in the Deque. | |
virtual const E & | getLast () const =0 |
virtual bool | peekFirst (E &value) const =0 |
Retrieves the first element contained in this Deque and assigns its value to the reference value passed the value however is not removed from the Deque. | |
virtual bool | peekLast (E &value) const =0 |
Retrieves the last element contained in this Deque and assigns its value to the reference value passed the value however is not removed from the Deque. | |
virtual bool | removeFirstOccurrence (const E &value)=0 |
Removes the first occurrence of the specified element from this Deque. | |
virtual bool | removeLastOccurrence (const E &value)=0 |
Removes the last occurrence of the specified element from this Deque. | |
virtual void | push (const E &element)=0 |
Pushes an element onto the stack represented by this deque (in other words, at the head of this deque) if it is possible to do so immediately without violating capacity restrictions, otherwise it throwing an IllegalStateException if no space is currently available. | |
virtual E | pop ()=0 |
Treats this Deque as a stack and attempts to pop an element off the top. | |
virtual Iterator< E > * | descendingIterator ()=0 |
Provides an Iterator over this Collection that traverses the element in reverse order. | |
virtual Iterator< E > * | descendingIterator () const =0 |
Defines a 'Double ended Queue' interface that allows for insertion and removal of elements from both ends.
Generally there is no limit on the number of elements that can be placed into a Deque.
Unlike a List the Deque doesn't provide index element based access, however methods are provided to grant access to interior elements.
virtual decaf::util::Deque< E >::~Deque | ( | ) | [inline, virtual] |
virtual void decaf::util::Deque< E >::addFirst | ( | const E & | element | ) | [pure virtual] |
Inserts an element onto the front of the Deque if possible without violating the implementations capacity restrictions.
For a capacity restricted Deque it is preferable to call offerFirst instead.
element | The element to be placed at the front of the Deque. |
IllegalStateException | if the element cannot be added at this time due to capacity restrictions |
NullPointerException | if the specified element is NULL and this deque is a Collection of pointers and does not permit null elements. |
IllegalArgumentException | if some property of the specified element prevents it from being added to this deque. |
Implemented in decaf::util::LinkedList< E >, decaf::util::LinkedList< Pointer< Transport > >, decaf::util::LinkedList< cms::MessageConsumer * >, decaf::util::LinkedList< CompositeTask * >, decaf::util::LinkedList< URI >, decaf::util::LinkedList< Pointer< MessageDispatch > >, decaf::util::LinkedList< Pointer< DestinationInfo > >, decaf::util::LinkedList< PrimitiveValueNode >, decaf::util::LinkedList< Pointer< Command > >, decaf::util::LinkedList< Pointer< BackupTransport > >, decaf::util::LinkedList< cms::MessageProducer * >, decaf::util::LinkedList< cms::Destination * >, decaf::util::LinkedList< cms::Session * >, and decaf::util::LinkedList< cms::Connection * >.
virtual void decaf::util::Deque< E >::addLast | ( | const E & | element | ) | [pure virtual] |
Inserts an element onto the end of the Deque if possible without violating the implementations capacity restrictions.
For a capacity restricted Deque it is preferable to call offerLast instead.
element | The element to be placed at the end of the Deque. |
IllegalStateException | if the element cannot be added at this time due to capacity restrictions |
NullPointerException | if the specified element is NULL and this deque is a Collection of pointers and does not permit null elements. |
IllegalArgumentException | if some property of the specified element prevents it from being added to this deque. |
Implemented in decaf::util::LinkedList< E >, decaf::util::LinkedList< Pointer< Transport > >, decaf::util::LinkedList< cms::MessageConsumer * >, decaf::util::LinkedList< CompositeTask * >, decaf::util::LinkedList< URI >, decaf::util::LinkedList< Pointer< MessageDispatch > >, decaf::util::LinkedList< Pointer< DestinationInfo > >, decaf::util::LinkedList< PrimitiveValueNode >, decaf::util::LinkedList< Pointer< Command > >, decaf::util::LinkedList< Pointer< BackupTransport > >, decaf::util::LinkedList< cms::MessageProducer * >, decaf::util::LinkedList< cms::Destination * >, decaf::util::LinkedList< cms::Session * >, and decaf::util::LinkedList< cms::Connection * >.
virtual Iterator<E>* decaf::util::Deque< E >::descendingIterator | ( | ) | [pure virtual] |
Provides an Iterator over this Collection that traverses the element in reverse order.
Implemented in decaf::util::LinkedList< E >, decaf::util::LinkedList< Pointer< Transport > >, decaf::util::LinkedList< cms::MessageConsumer * >, decaf::util::LinkedList< CompositeTask * >, decaf::util::LinkedList< URI >, decaf::util::LinkedList< Pointer< MessageDispatch > >, decaf::util::LinkedList< Pointer< DestinationInfo > >, decaf::util::LinkedList< PrimitiveValueNode >, decaf::util::LinkedList< Pointer< Command > >, decaf::util::LinkedList< Pointer< BackupTransport > >, decaf::util::LinkedList< cms::MessageProducer * >, decaf::util::LinkedList< cms::Destination * >, decaf::util::LinkedList< cms::Session * >, and decaf::util::LinkedList< cms::Connection * >.
virtual Iterator<E>* decaf::util::Deque< E >::descendingIterator | ( | ) | const [pure virtual] |
Implemented in decaf::util::LinkedList< E >, decaf::util::LinkedList< Pointer< Transport > >, decaf::util::LinkedList< cms::MessageConsumer * >, decaf::util::LinkedList< CompositeTask * >, decaf::util::LinkedList< URI >, decaf::util::LinkedList< Pointer< MessageDispatch > >, decaf::util::LinkedList< Pointer< DestinationInfo > >, decaf::util::LinkedList< PrimitiveValueNode >, decaf::util::LinkedList< Pointer< Command > >, decaf::util::LinkedList< Pointer< BackupTransport > >, decaf::util::LinkedList< cms::MessageProducer * >, decaf::util::LinkedList< cms::Destination * >, decaf::util::LinkedList< cms::Session * >, and decaf::util::LinkedList< cms::Connection * >.
virtual E& decaf::util::Deque< E >::getFirst | ( | ) | [pure virtual] |
Attempts to fetch a reference to the first element in the Deque.
This method does not remove the element from the Deque but simply returns a reference to it.
NoSuchElementException | if the Deque is empty. |
Implemented in decaf::util::LinkedList< E >, decaf::util::LinkedList< Pointer< Transport > >, decaf::util::LinkedList< cms::MessageConsumer * >, decaf::util::LinkedList< CompositeTask * >, decaf::util::LinkedList< URI >, decaf::util::LinkedList< Pointer< MessageDispatch > >, decaf::util::LinkedList< Pointer< DestinationInfo > >, decaf::util::LinkedList< PrimitiveValueNode >, decaf::util::LinkedList< Pointer< Command > >, decaf::util::LinkedList< Pointer< BackupTransport > >, decaf::util::LinkedList< cms::MessageProducer * >, decaf::util::LinkedList< cms::Destination * >, decaf::util::LinkedList< cms::Session * >, and decaf::util::LinkedList< cms::Connection * >.
virtual const E& decaf::util::Deque< E >::getFirst | ( | ) | const [pure virtual] |
Implemented in decaf::util::LinkedList< E >, decaf::util::LinkedList< Pointer< Transport > >, decaf::util::LinkedList< cms::MessageConsumer * >, decaf::util::LinkedList< CompositeTask * >, decaf::util::LinkedList< URI >, decaf::util::LinkedList< Pointer< MessageDispatch > >, decaf::util::LinkedList< Pointer< DestinationInfo > >, decaf::util::LinkedList< PrimitiveValueNode >, decaf::util::LinkedList< Pointer< Command > >, decaf::util::LinkedList< Pointer< BackupTransport > >, decaf::util::LinkedList< cms::MessageProducer * >, decaf::util::LinkedList< cms::Destination * >, decaf::util::LinkedList< cms::Session * >, and decaf::util::LinkedList< cms::Connection * >.
virtual E& decaf::util::Deque< E >::getLast | ( | ) | [pure virtual] |
Attempts to fetch a reference to the last element in the Deque.
This method does not remove the element from the Deque but simply returns a reference to it.
NoSuchElementException | if the Deque is empty. |
Implemented in decaf::util::LinkedList< E >, decaf::util::LinkedList< Pointer< Transport > >, decaf::util::LinkedList< cms::MessageConsumer * >, decaf::util::LinkedList< CompositeTask * >, decaf::util::LinkedList< URI >, decaf::util::LinkedList< Pointer< MessageDispatch > >, decaf::util::LinkedList< Pointer< DestinationInfo > >, decaf::util::LinkedList< PrimitiveValueNode >, decaf::util::LinkedList< Pointer< Command > >, decaf::util::LinkedList< Pointer< BackupTransport > >, decaf::util::LinkedList< cms::MessageProducer * >, decaf::util::LinkedList< cms::Destination * >, decaf::util::LinkedList< cms::Session * >, and decaf::util::LinkedList< cms::Connection * >.
virtual const E& decaf::util::Deque< E >::getLast | ( | ) | const [pure virtual] |
Implemented in decaf::util::LinkedList< E >, decaf::util::LinkedList< Pointer< Transport > >, decaf::util::LinkedList< cms::MessageConsumer * >, decaf::util::LinkedList< CompositeTask * >, decaf::util::LinkedList< URI >, decaf::util::LinkedList< Pointer< MessageDispatch > >, decaf::util::LinkedList< Pointer< DestinationInfo > >, decaf::util::LinkedList< PrimitiveValueNode >, decaf::util::LinkedList< Pointer< Command > >, decaf::util::LinkedList< Pointer< BackupTransport > >, decaf::util::LinkedList< cms::MessageProducer * >, decaf::util::LinkedList< cms::Destination * >, decaf::util::LinkedList< cms::Session * >, and decaf::util::LinkedList< cms::Connection * >.
virtual bool decaf::util::Deque< E >::offerFirst | ( | const E & | element | ) | [pure virtual] |
This method attempts to insert the given element into the Deque at the front end.
Unlike the addFirst method that throws an exception if it cannot insert the element due to capacity restrictions etc this method returns false if it cannot insert the element.
element | The element to add to this Deque. |
NullPointerException | if the specified element is NULL and this deque is a Collection of pointers and does not permit null elements. |
IllegalArgumentException | if some property of the specified element prevents it from being added to this deque. |
Implemented in decaf::util::LinkedList< E >, decaf::util::LinkedList< Pointer< Transport > >, decaf::util::LinkedList< cms::MessageConsumer * >, decaf::util::LinkedList< CompositeTask * >, decaf::util::LinkedList< URI >, decaf::util::LinkedList< Pointer< MessageDispatch > >, decaf::util::LinkedList< Pointer< DestinationInfo > >, decaf::util::LinkedList< PrimitiveValueNode >, decaf::util::LinkedList< Pointer< Command > >, decaf::util::LinkedList< Pointer< BackupTransport > >, decaf::util::LinkedList< cms::MessageProducer * >, decaf::util::LinkedList< cms::Destination * >, decaf::util::LinkedList< cms::Session * >, and decaf::util::LinkedList< cms::Connection * >.
virtual bool decaf::util::Deque< E >::offerLast | ( | const E & | element | ) | [pure virtual] |
This method attempts to insert the given element into the Deque at the end.
Unlike the addLast method that throws an exception if it cannot insert the element due to capacity restrictions etc this method returns false if it cannot insert the element.
element | The element to add to this Deque. |
NullPointerException | if the specified element is NULL and this deque is a Collection of pointers and does not permit null elements. |
IllegalArgumentException | if some property of the specified element prevents it from being added to this deque. |
Implemented in decaf::util::LinkedList< E >, decaf::util::LinkedList< Pointer< Transport > >, decaf::util::LinkedList< cms::MessageConsumer * >, decaf::util::LinkedList< CompositeTask * >, decaf::util::LinkedList< URI >, decaf::util::LinkedList< Pointer< MessageDispatch > >, decaf::util::LinkedList< Pointer< DestinationInfo > >, decaf::util::LinkedList< PrimitiveValueNode >, decaf::util::LinkedList< Pointer< Command > >, decaf::util::LinkedList< Pointer< BackupTransport > >, decaf::util::LinkedList< cms::MessageProducer * >, decaf::util::LinkedList< cms::Destination * >, decaf::util::LinkedList< cms::Session * >, and decaf::util::LinkedList< cms::Connection * >.
virtual bool decaf::util::Deque< E >::peekFirst | ( | E & | value | ) | const [pure virtual] |
Retrieves the first element contained in this Deque and assigns its value to the reference value passed the value however is not removed from the Deque.
If this call is successful it returns true. Unlike getFirst this method does not throw an exception if the Deque is empty.
Implemented in decaf::util::LinkedList< E >, decaf::util::LinkedList< Pointer< Transport > >, decaf::util::LinkedList< cms::MessageConsumer * >, decaf::util::LinkedList< CompositeTask * >, decaf::util::LinkedList< URI >, decaf::util::LinkedList< Pointer< MessageDispatch > >, decaf::util::LinkedList< Pointer< DestinationInfo > >, decaf::util::LinkedList< PrimitiveValueNode >, decaf::util::LinkedList< Pointer< Command > >, decaf::util::LinkedList< Pointer< BackupTransport > >, decaf::util::LinkedList< cms::MessageProducer * >, decaf::util::LinkedList< cms::Destination * >, decaf::util::LinkedList< cms::Session * >, and decaf::util::LinkedList< cms::Connection * >.
virtual bool decaf::util::Deque< E >::peekLast | ( | E & | value | ) | const [pure virtual] |
Retrieves the last element contained in this Deque and assigns its value to the reference value passed the value however is not removed from the Deque.
If this call is successful it returns true. Unlike getLast this method does not throw an exception if the Deque is empty.
Implemented in decaf::util::LinkedList< E >, decaf::util::LinkedList< Pointer< Transport > >, decaf::util::LinkedList< cms::MessageConsumer * >, decaf::util::LinkedList< CompositeTask * >, decaf::util::LinkedList< URI >, decaf::util::LinkedList< Pointer< MessageDispatch > >, decaf::util::LinkedList< Pointer< DestinationInfo > >, decaf::util::LinkedList< PrimitiveValueNode >, decaf::util::LinkedList< Pointer< Command > >, decaf::util::LinkedList< Pointer< BackupTransport > >, decaf::util::LinkedList< cms::MessageProducer * >, decaf::util::LinkedList< cms::Destination * >, decaf::util::LinkedList< cms::Session * >, and decaf::util::LinkedList< cms::Connection * >.
virtual bool decaf::util::Deque< E >::pollFirst | ( | E & | element | ) | [pure virtual] |
Removes the first element from the Deque assigns it to the element reference passed.
element | Reference to an variable that can be assigned the value of the head of this Deque. |
Implemented in decaf::util::LinkedList< E >, decaf::util::LinkedList< Pointer< Transport > >, decaf::util::LinkedList< cms::MessageConsumer * >, decaf::util::LinkedList< CompositeTask * >, decaf::util::LinkedList< URI >, decaf::util::LinkedList< Pointer< MessageDispatch > >, decaf::util::LinkedList< Pointer< DestinationInfo > >, decaf::util::LinkedList< PrimitiveValueNode >, decaf::util::LinkedList< Pointer< Command > >, decaf::util::LinkedList< Pointer< BackupTransport > >, decaf::util::LinkedList< cms::MessageProducer * >, decaf::util::LinkedList< cms::Destination * >, decaf::util::LinkedList< cms::Session * >, and decaf::util::LinkedList< cms::Connection * >.
virtual bool decaf::util::Deque< E >::pollLast | ( | E & | element | ) | [pure virtual] |
Removes the last element from the Deque assigns it to the element reference passed.
element | Reference to an variable that can be assigned the value of the tail of this Deque. |
Implemented in decaf::util::LinkedList< E >, decaf::util::LinkedList< Pointer< Transport > >, decaf::util::LinkedList< cms::MessageConsumer * >, decaf::util::LinkedList< CompositeTask * >, decaf::util::LinkedList< URI >, decaf::util::LinkedList< Pointer< MessageDispatch > >, decaf::util::LinkedList< Pointer< DestinationInfo > >, decaf::util::LinkedList< PrimitiveValueNode >, decaf::util::LinkedList< Pointer< Command > >, decaf::util::LinkedList< Pointer< BackupTransport > >, decaf::util::LinkedList< cms::MessageProducer * >, decaf::util::LinkedList< cms::Destination * >, decaf::util::LinkedList< cms::Session * >, and decaf::util::LinkedList< cms::Connection * >.
virtual E decaf::util::Deque< E >::pop | ( | ) | [pure virtual] |
Treats this Deque as a stack and attempts to pop an element off the top.
If there's no element to pop then a NuSuchElementException is thrown, otherwise the top element is removed and assigned to the reference passed.
This operation performs the same basic function as the removeFirst method.
NoSuchElementException | if there is nothing on the top of the stack. |
Implemented in decaf::util::LinkedList< E >, decaf::util::LinkedList< Pointer< Transport > >, decaf::util::LinkedList< cms::MessageConsumer * >, decaf::util::LinkedList< CompositeTask * >, decaf::util::LinkedList< URI >, decaf::util::LinkedList< Pointer< MessageDispatch > >, decaf::util::LinkedList< Pointer< DestinationInfo > >, decaf::util::LinkedList< PrimitiveValueNode >, decaf::util::LinkedList< Pointer< Command > >, decaf::util::LinkedList< Pointer< BackupTransport > >, decaf::util::LinkedList< cms::MessageProducer * >, decaf::util::LinkedList< cms::Destination * >, decaf::util::LinkedList< cms::Session * >, and decaf::util::LinkedList< cms::Connection * >.
virtual void decaf::util::Deque< E >::push | ( | const E & | element | ) | [pure virtual] |
Pushes an element onto the stack represented by this deque (in other words, at the head of this deque) if it is possible to do so immediately without violating capacity restrictions, otherwise it throwing an IllegalStateException if no space is currently available.
This method performs the same basic operation as the addFirst method.
element | The element to be pushed onto the Deque. |
IllegalStateException | if the element cannot be added at this time due to capacity restrictions |
NullPointerException | if the specified element is NULL and this deque is a Collection of pointers and does not permit null elements. |
IllegalArgumentException | if some property of the specified element prevents it from being added to this deque. |
Implemented in decaf::util::LinkedList< E >, decaf::util::LinkedList< Pointer< Transport > >, decaf::util::LinkedList< cms::MessageConsumer * >, decaf::util::LinkedList< CompositeTask * >, decaf::util::LinkedList< URI >, decaf::util::LinkedList< Pointer< MessageDispatch > >, decaf::util::LinkedList< Pointer< DestinationInfo > >, decaf::util::LinkedList< PrimitiveValueNode >, decaf::util::LinkedList< Pointer< Command > >, decaf::util::LinkedList< Pointer< BackupTransport > >, decaf::util::LinkedList< cms::MessageProducer * >, decaf::util::LinkedList< cms::Destination * >, decaf::util::LinkedList< cms::Session * >, and decaf::util::LinkedList< cms::Connection * >.
virtual E decaf::util::Deque< E >::removeFirst | ( | ) | [pure virtual] |
Removes the topmost element from the Deque and returns it.
Unlike the pollFirst method this method throws a NuSuchElementException if the Deque is empty.
NoSuchElementException | if the Deque is empty. |
Implemented in decaf::util::LinkedList< E >, decaf::util::LinkedList< Pointer< Transport > >, decaf::util::LinkedList< cms::MessageConsumer * >, decaf::util::LinkedList< CompositeTask * >, decaf::util::LinkedList< URI >, decaf::util::LinkedList< Pointer< MessageDispatch > >, decaf::util::LinkedList< Pointer< DestinationInfo > >, decaf::util::LinkedList< PrimitiveValueNode >, decaf::util::LinkedList< Pointer< Command > >, decaf::util::LinkedList< Pointer< BackupTransport > >, decaf::util::LinkedList< cms::MessageProducer * >, decaf::util::LinkedList< cms::Destination * >, decaf::util::LinkedList< cms::Session * >, and decaf::util::LinkedList< cms::Connection * >.
virtual bool decaf::util::Deque< E >::removeFirstOccurrence | ( | const E & | value | ) | [pure virtual] |
Removes the first occurrence of the specified element from this Deque.
If there is no matching element then the Deque is left unchanged.
value | The value to be removed from this Deque. |
NullPointerException | if the specified element is NULL and this deque is a Collection of pointers and does not permit null elements. |
Implemented in decaf::util::LinkedList< E >, decaf::util::LinkedList< Pointer< Transport > >, decaf::util::LinkedList< cms::MessageConsumer * >, decaf::util::LinkedList< CompositeTask * >, decaf::util::LinkedList< URI >, decaf::util::LinkedList< Pointer< MessageDispatch > >, decaf::util::LinkedList< Pointer< DestinationInfo > >, decaf::util::LinkedList< PrimitiveValueNode >, decaf::util::LinkedList< Pointer< Command > >, decaf::util::LinkedList< Pointer< BackupTransport > >, decaf::util::LinkedList< cms::MessageProducer * >, decaf::util::LinkedList< cms::Destination * >, decaf::util::LinkedList< cms::Session * >, and decaf::util::LinkedList< cms::Connection * >.
virtual E decaf::util::Deque< E >::removeLast | ( | ) | [pure virtual] |
Removes the last element from the Deque and returns it.
Unlike the pollLast method this method throws a NuSuchElementException if the Deque is empty.
NoSuchElementException | if the Deque is empty. |
Implemented in decaf::util::LinkedList< E >, decaf::util::LinkedList< Pointer< Transport > >, decaf::util::LinkedList< cms::MessageConsumer * >, decaf::util::LinkedList< CompositeTask * >, decaf::util::LinkedList< URI >, decaf::util::LinkedList< Pointer< MessageDispatch > >, decaf::util::LinkedList< Pointer< DestinationInfo > >, decaf::util::LinkedList< PrimitiveValueNode >, decaf::util::LinkedList< Pointer< Command > >, decaf::util::LinkedList< Pointer< BackupTransport > >, decaf::util::LinkedList< cms::MessageProducer * >, decaf::util::LinkedList< cms::Destination * >, decaf::util::LinkedList< cms::Session * >, and decaf::util::LinkedList< cms::Connection * >.
virtual bool decaf::util::Deque< E >::removeLastOccurrence | ( | const E & | value | ) | [pure virtual] |
Removes the last occurrence of the specified element from this Deque.
If there is no matching element then the Deque is left unchanged.
value | The value to be removed from this Deque. |
NullPointerException | if the specified element is NULL and this deque is a Collection of pointers and does not permit null elements. |
Implemented in decaf::util::LinkedList< E >, decaf::util::LinkedList< Pointer< Transport > >, decaf::util::LinkedList< cms::MessageConsumer * >, decaf::util::LinkedList< CompositeTask * >, decaf::util::LinkedList< URI >, decaf::util::LinkedList< Pointer< MessageDispatch > >, decaf::util::LinkedList< Pointer< DestinationInfo > >, decaf::util::LinkedList< PrimitiveValueNode >, decaf::util::LinkedList< Pointer< Command > >, decaf::util::LinkedList< Pointer< BackupTransport > >, decaf::util::LinkedList< cms::MessageProducer * >, decaf::util::LinkedList< cms::Destination * >, decaf::util::LinkedList< cms::Session * >, and decaf::util::LinkedList< cms::Connection * >.