activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1050221 [3/8] - in /activemq/activemq-cpp/trunk/activemq-cpp/src: main/ main/activemq/cmsutil/ main/activemq/core/ main/activemq/state/ main/activemq/threads/ main/activemq/transport/ main/activemq/transport/failover/ main/activemq/util/ m...
Date Thu, 16 Dec 2010 23:18:06 GMT
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/ConcurrentModificationException.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/ConcurrentModificationException.h?rev=1050221&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/ConcurrentModificationException.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/ConcurrentModificationException.h Thu Dec 16 23:18:02 2010
@@ -0,0 +1,119 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _DECAF_UTIL_CONCURRENTMODIFICATIONEXCEPTION_H_
+#define _DECAF_UTIL_CONCURRENTMODIFICATIONEXCEPTION_H_
+
+#include <decaf/util/Config.h>
+#include <decaf/lang/exceptions/RuntimeException.h>
+
+namespace decaf{
+namespace util{
+
+    class DECAF_API ConcurrentModificationException :
+        public lang::exceptions::RuntimeException {
+    public:
+
+        /**
+         * Default Constructor
+         */
+        ConcurrentModificationException() throw();
+
+        /**
+         * Copy Constructor
+         * @param ex the exception to copy
+         */
+        ConcurrentModificationException( const lang::Exception& ex ) throw()
+        : lang::exceptions::RuntimeException() {
+            *(lang::Exception*)this = ex;
+        }
+
+        /**
+         * Copy Constructor
+         * @param ex the exception to copy, which is an instance of this type
+         */
+        ConcurrentModificationException( const ConcurrentModificationException& ex ) throw()
+        : lang::exceptions::RuntimeException() {
+            *(lang::Exception*)this = ex;
+        }
+
+        /**
+         * Constructor - Initializes the file name and line number where
+         * this message occurred.  Sets the message to report, using an
+         * optional list of arguments to parse into the message
+         * @param file The file name where exception occurs
+         * @param lineNumber The line number where the exception occurred.
+         * @param cause The exception that was the cause for this one to be thrown.
+         * @param msg The message to report
+         * @param ... list of primitives that are formatted into the message
+         */
+        ConcurrentModificationException( const char* file, const int lineNumber,
+                                         const std::exception* cause,
+                                         const char* msg, ... )
+            throw() : lang::exceptions::RuntimeException( cause )
+        {
+            va_list vargs;
+            va_start( vargs, msg );
+            buildMessage( msg, vargs );
+
+            // Set the first mark for this exception.
+            setMark( file, lineNumber );
+        }
+
+        /**
+         * Constructor
+         * @param cause Pointer to the exception that caused this one to
+         * be thrown, the object is cloned caller retains ownership.
+         */
+        ConcurrentModificationException( const std::exception* cause )
+            throw() : lang::exceptions::RuntimeException( cause ) {}
+
+        /**
+         * Constructor
+         * @param file The file name where exception occurs
+         * @param lineNumber The line number where the exception occurred.
+         * @param msg The message to report
+         * @param ... list of primitives that are formatted into the message
+         */
+        ConcurrentModificationException( const char* file, const int lineNumber,
+                                         const char* msg, ... ) throw()
+        : lang::exceptions::RuntimeException() {
+
+            va_list vargs;
+            va_start( vargs, msg );
+            buildMessage( msg, vargs );
+
+            // Set the first mark for this exception.
+            setMark( file, lineNumber );
+        }
+
+        /**
+         * Clones this exception.  This is useful for cases where you need
+         * to preserve the type of the original exception as well as the message.
+         * All subclasses should override.
+         */
+        virtual ConcurrentModificationException* clone() const {
+            return new ConcurrentModificationException( *this );
+        }
+
+        virtual ~ConcurrentModificationException() throw();
+
+    };
+
+}}
+
+#endif /*_DECAF_UTIL_CONCURRENTMODIFICATIONEXCEPTION_H_*/

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/ConcurrentModificationException.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/ConcurrentModificationException.h
------------------------------------------------------------------------------
    svn:executable = *

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Deque.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Deque.cpp?rev=1050221&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Deque.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Deque.cpp Thu Dec 16 23:18:02 2010
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Deque.h"

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Deque.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Deque.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Deque.h?rev=1050221&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Deque.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Deque.h Thu Dec 16 23:18:02 2010
@@ -0,0 +1,269 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _DECAF_UTIL_DEQUE_H_
+#define _DECAF_UTIL_DEQUE_H_
+
+#include <decaf/util/NoSuchElementException.h>
+#include <decaf/lang/exceptions/NullPointerException.h>
+#include <decaf/lang/exceptions/IllegalArgumentException.h>
+#include <decaf/lang/exceptions/IllegalStateException.h>
+#include <decaf/util/Config.h>
+#include <decaf/util/Queue.h>
+
+namespace decaf {
+namespace util {
+
+    /**
+     * 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.
+     *
+     * @since 1.0
+     */
+    template<typename E>
+    class Deque : public Queue<E> {
+    public:
+
+        virtual ~Deque() {}
+
+        /**
+         * 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.
+         *
+         * @param element
+         *      The element to be placed at the front of the Deque.
+         *
+         * @throws IllegalStateException if the element cannot be added at this time due to
+         *         capacity restrictions
+         * @throws NullPointerException if the specified element is NULL and this deque is a Collection
+         *         of pointers and does not permit null elements.
+         * @throws IllegalArgumentException if some property of the specified element prevents it
+         *         from being added to this deque.
+         */
+        virtual void addFirst( const E& element ) = 0;
+
+        /**
+         * 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.
+         *
+         * @param element
+         *      The element to be placed at the end of the Deque.
+         *
+         * @throws IllegalStateException if the element cannot be added at this time due to
+         *         capacity restrictions
+         * @throws NullPointerException if the specified element is NULL and this deque is a Collection
+         *         of pointers and does not permit null elements.
+         * @throws IllegalArgumentException if some property of the specified element prevents it
+         *         from being added to this deque.
+         */
+        virtual void addLast( const E& element ) = 0;
+
+        /**
+         * 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.
+         *
+         * @param element
+         *      The element to add to this Deque.
+         *
+         * @returns true if the element was added, false otherwise.
+         *
+         * @throws NullPointerException if the specified element is NULL and this deque is a Collection
+         *         of pointers and does not permit null elements.
+         * @throws IllegalArgumentException if some property of the specified element prevents it
+         *         from being added to this deque.
+         */
+        virtual bool offerFirst( const E& element ) = 0;
+
+        /**
+         * 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.
+         *
+         * @param element
+         *      The element to add to this Deque.
+         *
+         * @returns true if the element was added, false otherwise.
+         *
+         * @throws NullPointerException if the specified element is NULL and this deque is a Collection
+         *         of pointers and does not permit null elements.
+         * @throws IllegalArgumentException if some property of the specified element prevents it
+         *         from being added to this deque.
+         */
+        virtual bool offerLast( const E& element ) = 0;
+
+        /**
+         * Removes the topmost element from the Deque and returns it.  Unlike the pollFirst
+         * method this method throws a NuSuchElementException if the Deque is empty.
+         *
+         * @returns the element at the Head of the Deque.
+         *
+         * @throws NoSuchElementException if the Deque is empty.
+         */
+        virtual E removeFirst() = 0;
+
+        /**
+         * Removes the last element from the Deque and returns it.  Unlike the pollLast
+         * method this method throws a NuSuchElementException if the Deque is empty.
+         *
+         * @returns the element at the Tail of the Deque.
+         *
+         * @throws NoSuchElementException if the Deque is empty.
+         */
+        virtual E removeLast() = 0;
+
+        /**
+         * Removes the first element from the Deque assigns it to the element reference passed.
+         *
+         * @param element
+         *      Reference to an variable that can be assigned the value of the head of this Deque.
+         *
+         * @returns true if an element was available to remove, false otherwise.
+         */
+        virtual bool pollFirst( E& element ) = 0;
+
+        /**
+         * Removes the last element from the Deque assigns it to the element reference passed.
+         *
+         * @param element
+         *      Reference to an variable that can be assigned the value of the tail of this Deque.
+         *
+         * @returns true if an element was available to remove, false otherwise.
+         */
+        virtual bool pollLast( E& element ) = 0;
+
+        /**
+         * 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.
+         *
+         * @returns reference to the first element in the Deque.
+         *
+         * @throws NoSuchElementException if the Deque is empty.
+         */
+        virtual E& getFirst() = 0;
+        virtual const E& getFirst() const = 0;
+
+        /**
+         * 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.
+         *
+         * @returns reference to the last element in the Deque.
+         *
+         * @throws NoSuchElementException if the Deque is empty.
+         */
+        virtual E& getLast() = 0;
+        virtual const E& getLast() 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.  If this
+         * call is successful it returns true.  Unlike getFirst this method does not throw an
+         * exception if the Deque is empty.
+         *
+         * @returns true if an element was assigned to the reference passed, false otherwise.
+         */
+        virtual bool peekFirst( 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.  If this
+         * call is successful it returns true.  Unlike getLast this method does not throw an
+         * exception if the Deque is empty.
+         *
+         * @returns true if an element was assigned to the reference passed, false otherwise.
+         */
+        virtual bool peekLast( E& value ) const = 0;
+
+        /**
+         * Removes the first occurrence of the specified element from this Deque.  If there is no
+         * matching element then the Deque is left unchanged.
+         *
+         * @param value
+         *      The value to be removed from this Deque.
+         *
+         * @returns true if the Deque was modified as a result of this operation.
+         *
+         * @throws NullPointerException if the specified element is NULL and this deque is a Collection
+         *         of pointers and does not permit null elements.
+         */
+        virtual bool removeFirstOccurrence( const E& value ) = 0;
+
+        /**
+         * Removes the last occurrence of the specified element from this Deque.  If there is no
+         * matching element then the Deque is left unchanged.
+         *
+         * @param value
+         *      The value to be removed from this Deque.
+         *
+         * @returns true if the Deque was modified as a result of this operation.
+         *
+         * @throws NullPointerException if the specified element is NULL and this deque is a Collection
+         *         of pointers and does not permit null elements.
+         */
+        virtual bool removeLastOccurrence( const E& value ) = 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.
+         *
+         * This method performs the same basic operation as the addFirst method.
+         *
+         * @param element
+         *      The element to be pushed onto the Deque.
+         *
+         * @throws IllegalStateException if the element cannot be added at this time due to
+         *         capacity restrictions
+         * @throws NullPointerException if the specified element is NULL and this deque is a Collection
+         *         of pointers and does not permit null elements.
+         * @throws IllegalArgumentException if some property of the specified element prevents it
+         *         from being added to this deque.
+         */
+        virtual void push( const E& element ) = 0;
+
+        /**
+         * 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.
+         *
+         * @return the element at the front of this deque which would be the top of a stack.
+         *
+         * @throws NoSuchElementException if there is nothing on the top of the stack.
+         */
+        virtual E pop() = 0;
+
+        /**
+         * Provides an Iterator over this Collection that traverses the element in reverse order.
+         *
+         * @returns a new Iterator instance that moves from last to first.
+         */
+        virtual Iterator<E>* descendingIterator() = 0;
+        virtual Iterator<E>* descendingIterator() const = 0;
+
+    };
+
+}}
+
+#endif /* _DECAF_UTIL_DEQUE_H_ */

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Deque.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Iterator.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Iterator.cpp?rev=1050221&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Iterator.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Iterator.cpp Thu Dec 16 23:18:02 2010
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Iterator.h"

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Iterator.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Iterator.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Iterator.h?rev=1050221&r1=1050220&r2=1050221&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Iterator.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Iterator.h Thu Dec 16 23:18:02 2010
@@ -18,7 +18,7 @@
 #ifndef _DECAF_UTIL_ITERATOR_H_
 #define _DECAF_UTIL_ITERATOR_H_
 
-#include <decaf/lang/exceptions/NoSuchElementException.h>
+#include <decaf/util/NoSuchElementException.h>
 #include <decaf/lang/exceptions/IllegalStateException.h>
 #include <decaf/lang/exceptions/UnsupportedOperationException.h>
 
@@ -30,7 +30,7 @@ namespace util{
      * collection.  The iterator provides a way to access and remove elements
      * with well defined semantics.
      */
-    template< typename T>
+    template< typename E>
     class Iterator {
     public:
 
@@ -40,15 +40,19 @@ namespace util{
          * Returns the next element in the iteration. Calling this method
          * repeatedly until the hasNext() method returns false will return
          * each element in the underlying collection exactly once.
-         * @returns next element in the iteration of elements
-         * @throws NoSuchElementException - iteration has no more elements.
+         *
+         * @returns the next element in the iteration of elements.
+         *
+         * @throws NoSuchElementException if the iteration has no more elements.
          */
-        virtual T next() = 0;
+        virtual E next() = 0;
 
         /**
          * Returns true if the iteration has more elements.  Returns false if
          * the next call to next would result in an NoSuchElementException to
          * be thrown.
+         *
+         * @returns true if there are more elements available for iteration.
          */
         virtual bool hasNext() const = 0;
 
@@ -59,11 +63,12 @@ namespace util{
          * unspecified if the underlying collection is modified while the
          * iteration is in progress in any way other than by calling this
          * method.
-         * @throws UnsupportedOperationException - if the remove  operation
-         *         is not supported by this Iterator.
-         * @throws IllegalStateException - if the next method has not yet been
+         *
+         * @throws UnsupportedOperationException if the remove  operation is
+         *         not supported by this Iterator.
+         * @throws IllegalStateException if the next method has not yet been
          *         called, or the remove method has already been called after
-         *         the last call to the next  method.
+         *         the last call to the next method.
          */
         virtual void remove() = 0;
 

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/LinkedList.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/LinkedList.cpp?rev=1050221&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/LinkedList.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/LinkedList.cpp Thu Dec 16 23:18:02 2010
@@ -0,0 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "LinkedList.h"
+

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/LinkedList.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/LinkedList.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/LinkedList.h?rev=1050221&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/LinkedList.h (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/LinkedList.h Thu Dec 16 23:18:02 2010
@@ -0,0 +1,1033 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _DECAF_UTIL_LINKEDLIST_H_
+#define _DECAF_UTIL_LINKEDLIST_H_
+
+#include <list>
+#include <memory>
+#include <decaf/util/NoSuchElementException.h>
+#include <decaf/lang/exceptions/UnsupportedOperationException.h>
+#include <decaf/lang/exceptions/IndexOutOfBoundsException.h>
+#include <decaf/lang/System.h>
+#include <decaf/lang/Integer.h>
+#include <decaf/util/Config.h>
+#include <decaf/util/Deque.h>
+#include <decaf/util/ArrayList.h>
+#include <decaf/util/Iterator.h>
+#include <decaf/util/ListIterator.h>
+#include <decaf/util/AbstractSequentialList.h>
+
+namespace decaf {
+namespace util {
+
+    using decaf::lang::System;
+
+    /**
+     * A complete implementation of the List interface using a doubly linked list data structure.
+     *
+     * This class also implements the Deque interface providing a common interface for additions
+     * into the list at the front and end as well as allowing insertions anywhere in between.
+     * This class can be used then to implement other data structures such as Stacks, Queue's or
+     * double ended Queue's.
+     *
+     * The operations on this List object that index a particular element involve iterating over
+     * the links of the list from beginning to end, starting from whichever end is closer to the
+     * location the operation is to be performed on.
+     *
+     * @since 1.0
+     */
+    template< typename E >
+    class LinkedList : public AbstractSequentialList<E>, public Deque<E> {
+    private:
+
+        template< typename U >
+        class ListNode {
+        public:
+
+            U value;
+            ListNode<U>* prev;
+            ListNode<U>* next;
+
+        public:
+
+            ListNode() : value(), prev(NULL), next(NULL) {
+            }
+
+            ListNode( const U& value ) : value(value), prev(NULL), next(NULL) {
+            }
+
+            ListNode( ListNode<U>* prev, ListNode<U>* next, const U& value ) :
+                value(value), prev(prev), next(next) {
+            }
+
+        };
+
+    private:
+
+        int listSize;
+        ListNode<E> head;
+        ListNode<E> tail;
+
+    public:
+
+        LinkedList() :
+            AbstractSequentialList<E>(), listSize(0), head(), tail() {
+
+            this->head.next = &this->tail;
+            this->tail.prev = &this->head;
+        }
+
+        LinkedList( const LinkedList<E>& list ) :
+            AbstractSequentialList<E>(), listSize(0), head(), tail() {
+
+            this->head.next = &this->tail;
+            this->tail.prev = &this->head;
+
+            this->addAllAtLocation( 0, list );
+        }
+
+        LinkedList( const Collection<E>& collection ) :
+            AbstractSequentialList<E>(), listSize(0), head(), tail() {
+
+            this->head.next = &this->tail;
+            this->tail.prev = &this->head;
+
+            this->addAllAtLocation( 0, collection );
+        }
+
+        virtual ~LinkedList() {
+            try{
+                this->purgeList();
+            } catch(...) {}
+        }
+
+    public:
+
+        LinkedList<E>& operator= ( const LinkedList<E>& list ) {
+            this->clear();
+            this->addAllAtLocation( 0, list );
+            return *this;
+        }
+
+        LinkedList<E>& operator= ( const Collection<E>& collection ) {
+            this->clear();
+            this->addAllAtLocation( 0, collection );
+            return *this;
+        }
+
+    public:
+
+        virtual E get( int index ) const {
+
+            if( index < 0 || index >= this->listSize ) {
+                throw decaf::lang::exceptions::IndexOutOfBoundsException(
+                    __FILE__, __LINE__, "Index given is outside bounds of this list {%d}", index );
+            }
+
+            const ListNode<E>* location = NULL;
+
+            if( index < this->listSize / 2 ) {
+                location = &this->head;
+                for( int i = 0; i <= index; ++i ) {
+                    location = location->next;
+                }
+            } else {
+                location = &this->tail;
+                for( int i = this->listSize; i > index; --i ) {
+                    location = location->prev;
+                }
+            }
+
+            return location->value;
+        }
+
+        virtual E set( int index, const E& element ) {
+
+            if( index < 0 || index >= this->listSize ) {
+                throw decaf::lang::exceptions::IndexOutOfBoundsException(
+                    __FILE__, __LINE__, "Index given is outside bounds of this list {%d}", index );
+            }
+
+            ListNode<E>* location = NULL;
+
+            if( index < this->listSize / 2 ) {
+                location = &this->head;
+                for( int i = 0; i <= index; ++i ) {
+                    location = location->next;
+                }
+            } else {
+                location = &this->tail;
+                for( int i = this->listSize; i > index; --i ) {
+                    location = location->prev;
+                }
+            }
+
+            E oldValue = location->value;
+            location->value = element;
+
+            return oldValue;
+        }
+
+        virtual bool add( const E& value ) {
+            this->addToEnd( value );
+            return true;
+        }
+
+        virtual void add( int index, const E& value ) {
+
+            if( index < 0 || index > this->listSize ) {
+                throw decaf::lang::exceptions::IndexOutOfBoundsException(
+                    __FILE__, __LINE__, "Index given is outside bounds of this list {%d}", index );
+            }
+
+            this->addAtLocation( index, value );
+        }
+
+        virtual bool addAll( const Collection<E>& collection ) {
+            return this->addAllAtLocation( this->listSize, collection );
+        }
+
+        virtual bool addAll( int index, const Collection<E>& collection ) {
+            return this->addAllAtLocation( index, collection );
+        }
+
+        virtual void copy( const Collection<E>& collection ) {
+            this->clear();
+            this->addAllAtLocation( 0, collection );
+        }
+
+        virtual bool remove( const E& value ) {
+            return this->removeFirstOccurrence( value );
+        }
+
+        virtual bool isEmpty() const {
+            return this->listSize == 0;
+        }
+
+        virtual int size() const {
+            return this->listSize;
+        }
+
+        virtual void clear() {
+            this->purgeList();
+            this->head.next = &this->tail;
+            this->tail.prev = &this->head;
+            this->listSize = 0;
+            AbstractList<E>::modCount++;
+        }
+
+        virtual bool contains( const E& value ) const {
+            return this->indexOf( value ) != -1;
+        }
+
+        virtual int indexOf( const E& value ) const {
+
+            if( this->listSize == 0 ) {
+                return -1;
+            }
+
+            const ListNode<E>* location = this->head.next;
+
+            for( int i = 0; location != &this->tail; ++i, location = location->next ) {
+                if( location->value == value ) {
+                    return i;
+                }
+            }
+
+            return -1;
+        }
+
+        virtual int lastIndexOf( const E& value ) const {
+
+            if( this->listSize == 0 ) {
+                return -1;
+            }
+
+            const ListNode<E>* location = this->tail.prev;
+
+            for( int i = this->listSize - 1; location != &this->head; --i, location = location->prev ) {
+                if( location->value == value ) {
+                    return i;
+                }
+            }
+
+            return -1;
+        }
+
+        virtual std::vector<E> toArray() const {
+
+            std::vector<E> result;
+            result.reserve( this->listSize );
+
+            const ListNode<E>* current = this->head.next;
+
+            while( current != &this->tail ) {
+                result.push_back( current->value );
+                current = current->next;
+            }
+
+            return result;
+        }
+
+    public:  // Deque interface implementation.
+
+        virtual bool offer( const E& value ) {
+            this->addLast( value );
+            return true;
+        }
+
+        virtual bool poll( E& result ) {
+
+            if( this->listSize == 0 ) {
+                return false;
+            }
+
+            result = this->head.next->value;
+            this->removeAtFront();
+            return true;
+        }
+
+        virtual E remove() {
+            return this->removeAtFront();
+        }
+
+        virtual bool peek( E& result ) const {
+
+            if( this->listSize == 0 ) {
+                return false;
+            }
+
+            result = this->head.next->value;
+            return true;
+        }
+
+        virtual E element() const {
+            if( this->listSize == 0 ) {
+                throw decaf::util::NoSuchElementException(
+                    __FILE__, __LINE__, "The list is Empty" );
+            }
+
+            return this->head.next->value;
+        }
+
+        virtual void addFirst( const E& value ) {
+            this->addToFront( value );
+        }
+
+        virtual void addLast( const E& value ) {
+            this->addToEnd( value );
+        }
+
+        virtual E& getFirst() {
+            if( this->listSize == 0 ) {
+                throw decaf::util::NoSuchElementException(
+                    __FILE__, __LINE__, "The list is Empty" );
+            }
+
+            return this->head.next->value;
+        }
+
+        virtual const E& getFirst() const {
+            if( this->listSize == 0 ) {
+                throw decaf::util::NoSuchElementException(
+                    __FILE__, __LINE__, "The list is Empty" );
+            }
+
+            return this->head.next->value;
+        }
+
+        virtual E& getLast() {
+            if( this->listSize == 0 ) {
+                throw decaf::util::NoSuchElementException(
+                    __FILE__, __LINE__, "The list is Empty" );
+            }
+
+            return this->tail.prev->value;
+        }
+
+        virtual const E& getLast() const {
+            if( this->listSize == 0 ) {
+                throw decaf::util::NoSuchElementException(
+                    __FILE__, __LINE__, "The list is Empty" );
+            }
+
+            return this->tail.prev->value;
+        }
+
+        virtual bool offerFirst( const E& element ) {
+            this->addToFront( element );
+            return true;
+        }
+
+        virtual bool offerLast( const E& element ) {
+            this->addToEnd( element );
+            return true;
+        }
+
+        virtual E removeFirst() {
+            return this->removeAtFront();
+        }
+
+        virtual E removeLast() {
+            return this->removeAtEnd();
+        }
+
+        virtual bool pollFirst( E& result ) {
+            if( this->listSize == 0 ) {
+                return false;
+            }
+
+            result = this->head.next->value;
+            this->removeAtFront();
+            return true;
+        }
+
+        virtual bool pollLast( E& result ) {
+            if( this->listSize == 0 ) {
+                return false;
+            }
+
+            result = this->tail.prev->value;
+            this->removeAtEnd();
+            return true;
+        }
+
+        virtual bool peekFirst( E& result ) const {
+            if( this->listSize == 0 ) {
+                return false;
+            }
+
+            result = this->head.next->value;
+            return true;
+        }
+
+        virtual bool peekLast( E& result ) const {
+            if( this->listSize == 0 ) {
+                return false;
+            }
+
+            result = this->tail.prev->value;
+            return true;
+        }
+
+        virtual E pop() {
+            return this->removeAtFront();
+        }
+
+        virtual void push( const E& element ) {
+            this->addToFront( element );
+        }
+
+        virtual bool removeFirstOccurrence( const E& value ) {
+            std::auto_ptr< Iterator<E> > iter( this->iterator() );
+            while( iter->hasNext() ) {
+                if( iter->next() == value ) {
+                    iter->remove();
+                    return true;
+                }
+            }
+
+            return false;
+        }
+        virtual bool removeLastOccurrence( const E& value ) {
+            std::auto_ptr< Iterator<E> > iter( this->descendingIterator() );
+            while( iter->hasNext() ) {
+                if( iter->next() == value ) {
+                    iter->remove();
+                    return true;
+                }
+            }
+
+            return false;
+        }
+
+    private:
+
+        class LinkedListIterator : public ListIterator<E> {
+        private:
+
+            mutable LinkedList<E>* list;
+            ListNode<E>* current;
+            ListNode<E>* lastReturned;
+            int index;
+            int expectedModCount;
+
+        private:
+
+            LinkedListIterator( const LinkedListIterator& );
+            LinkedListIterator operator= ( const LinkedListIterator& );
+
+        public:
+
+            LinkedListIterator( LinkedList<E>* list, int index ) :
+                ListIterator<E>(), list(list), current(NULL), lastReturned(NULL), index(-1), expectedModCount(0) {
+
+                if( list == NULL ) {
+                    throw decaf::lang::exceptions::NullPointerException(
+                        __FILE__, __LINE__, "Parent LinkedList pointer was Null." );
+                }
+
+                if( index < 0 || index > list->listSize ) {
+                    throw decaf::lang::exceptions::IndexOutOfBoundsException(
+                        __FILE__, __LINE__, "Given index {%d} is out of range.", index );
+                }
+
+                this->expectedModCount = list->modCount;
+
+                // index starts at -1 to indicate that we are before begin or that the
+                // list is empty.  We always want to start out one before so that the call
+                // to next moves us onto the element in question;
+
+                if( index < this->list->listSize / 2 ) {
+                    this->current = &this->list->head;
+                    for( this->index = -1; this->index + 1 < index; ++this->index ) {
+                        this->current = this->current->next;
+                    }
+                } else {
+                    this->current = &this->list->tail;
+                    for( this->index = this->list->listSize; this->index >= index; --this->index ) {
+                        this->current = this->current->prev;
+                    }
+                }
+            }
+
+            virtual ~LinkedListIterator() {}
+
+            virtual E next() {
+
+                if( this->expectedModCount != this->list->modCount ) {
+                    throw ConcurrentModificationException(
+                        __FILE__, __LINE__, "List modified outside of this Iterator." );
+                }
+
+                if( this->current->next == &(this->list->tail) ) {
+                    throw NoSuchElementException(
+                        __FILE__, __LINE__, "No more elements to return from next()" );
+                }
+
+                this->current = this->current->next;
+                this->lastReturned = this->current;
+                this->index++;
+
+                return this->current->value;
+            }
+
+            virtual bool hasNext() const {
+                return ( this->current->next != &(this->list->tail) );
+            }
+
+
+            virtual E previous() {
+                if( this->expectedModCount != this->list->modCount ) {
+                    throw ConcurrentModificationException(
+                        __FILE__, __LINE__, "List modified outside of this Iterator." );
+                }
+
+                if( this->current == &(this->list->head) ) {
+                    throw decaf::lang::exceptions::IllegalStateException(
+                        __FILE__, __LINE__,
+                        "No previous element, must call next() before calling previous()." );
+                }
+
+                this->lastReturned = this->current;
+                this->current = this->current->prev;
+                this->index--;
+
+                return this->lastReturned->value;
+            }
+
+            virtual bool hasPrevious() const {
+                return ( this->current != &(this->list->head) );
+            }
+
+            virtual void remove() {
+                if( this->expectedModCount != this->list->modCount ) {
+                    throw ConcurrentModificationException(
+                        __FILE__, __LINE__, "List modified outside of this Iterator." );
+                }
+
+                if( this->lastReturned == NULL ) {
+                    throw lang::exceptions::IllegalStateException(
+                        __FILE__, __LINE__,
+                        "Invalid State to call remove, must call next() before remove()" );
+                }
+
+                ListNode<E>* next = this->lastReturned->next;
+                ListNode<E>* previous = this->lastReturned->prev;
+
+                next->prev = previous;
+                previous->next = next;
+
+                // When iterating in reverse this would not be true
+                if( this->current == this->lastReturned ) {
+                    this->index--;
+                }
+                this->current = previous;
+
+                delete this->lastReturned;
+                this->lastReturned = NULL;
+
+                this->list->listSize--;
+                this->list->modCount++;
+
+                this->expectedModCount++;
+            }
+
+            virtual void add( const E& e ) {
+                if( this->expectedModCount != this->list->modCount ) {
+                    throw ConcurrentModificationException(
+                        __FILE__, __LINE__, "List modified outside of this Iterator." );
+                }
+
+                ListNode<E>* newNode = new ListNode<E>( this->current, this->current->next, e );
+
+                this->current->next->prev = newNode;
+                this->current->next = newNode;
+
+                this->current = newNode;
+                this->lastReturned = NULL;
+
+                this->index++;
+                this->expectedModCount++;
+                this->list->modCount++;
+                this->list->listSize++;
+            }
+
+            virtual void set( const E& e ) {
+
+                if( this->expectedModCount != this->list->modCount ) {
+                    throw ConcurrentModificationException(
+                        __FILE__, __LINE__, "List modified outside of this Iterator." );
+                }
+
+                if( this->lastReturned != NULL ) {
+                    this->lastReturned->value = e;
+                } else {
+                    throw decaf::lang::exceptions::IllegalStateException(
+                        __FILE__, __LINE__, "Iterator next has not been called." );
+                }
+            }
+
+            virtual int nextIndex() const {
+                return this->index + 1;
+            }
+
+            virtual int previousIndex() const {
+                return this->index;
+            }
+        };
+
+        class ConstLinkedListIterator : public ListIterator<E> {
+        private:
+
+            const LinkedList<E>* list;
+            const ListNode<E>* current;
+            const ListNode<E>* lastReturned;
+            int index;
+
+        private:
+
+            ConstLinkedListIterator( const ConstLinkedListIterator& );
+            ConstLinkedListIterator operator= ( const ConstLinkedListIterator& );
+
+        public:
+
+            ConstLinkedListIterator( const LinkedList<E>* list, int index ) :
+                ListIterator<E>(), list(list), current(NULL), lastReturned(NULL), index(-1) {
+
+                if( list == NULL ) {
+                    throw decaf::lang::exceptions::NullPointerException(
+                        __FILE__, __LINE__, "Parent LinkedList pointer was Null." );
+                }
+
+                if( index < 0 || index > list->listSize ) {
+                    throw decaf::lang::exceptions::IndexOutOfBoundsException(
+                        __FILE__, __LINE__, "Given index {%d} is out of range.", index );
+                }
+
+                // index starts at -1 to indicate that we are before begin or that the
+                // list is empty.  We always want to start out one before so that the call
+                // to next moves us onto the element in question;
+
+                if( index < this->list->listSize / 2 ) {
+                    this->current = &this->list->head;
+                    for( this->index = -1; this->index + 1 < index; ++this->index ) {
+                        this->current = this->current->next;
+                    }
+                } else {
+                    this->current = &this->list->tail;
+                    for( this->index = this->list->listSize; this->index >= index; --this->index ) {
+                        this->current = this->current->prev;
+                    }
+                }
+            }
+
+            virtual ~ConstLinkedListIterator() {}
+
+            virtual E next() {
+
+                if( this->current->next == &(this->list->tail) ) {
+                    throw NoSuchElementException(
+                        __FILE__, __LINE__, "No more elements to return from this ListIterator" );
+                }
+
+                this->current = this->current->next;
+                this->lastReturned = this->current;
+                this->index++;
+
+                return this->current->value;
+            }
+
+            virtual bool hasNext() const {
+                return ( this->current->next != &(this->list->tail) );
+            }
+
+            virtual E previous() {
+
+                if( this->current == &(this->list->head) ) {
+                    throw decaf::lang::exceptions::IllegalStateException(
+                        __FILE__, __LINE__,
+                        "No previous element, must call next() before calling previous()." );
+                }
+
+                this->lastReturned = this->current;
+                this->current = this->current->prev;
+                this->index--;
+
+                return this->lastReturned->value;
+            }
+
+            virtual bool hasPrevious() const {
+                return ( this->current != &(this->list->head) );
+            }
+
+            virtual void remove() {
+                throw lang::exceptions::UnsupportedOperationException(
+                    __FILE__, __LINE__, "Cannot write to a const ListIterator." );
+            }
+
+            virtual void add( const E& e DECAF_UNUSED ) {
+                throw lang::exceptions::UnsupportedOperationException(
+                    __FILE__, __LINE__, "Cannot write to a const ListIterator." );
+            }
+
+            virtual void set( const E& e DECAF_UNUSED ) {
+                throw lang::exceptions::UnsupportedOperationException(
+                    __FILE__, __LINE__, "Cannot write to a const ListIterator." );
+            }
+
+            virtual int nextIndex() const {
+                return this->index + 1;
+            }
+
+            virtual int previousIndex() const {
+                return this->index;
+            }
+        };
+
+        class ReverseIterator : public Iterator<E> {
+        private:
+
+            LinkedList<E>* list;
+            ListNode<E>* current;
+            int expectedModCount;
+            bool canRemove;
+
+        public:
+
+            ReverseIterator( LinkedList<E>* list ) :
+                Iterator<E>(), list( list ), current(NULL), expectedModCount(0), canRemove(false) {
+
+                if( list == NULL ) {
+                    throw decaf::lang::exceptions::NullPointerException(
+                        __FILE__, __LINE__, "Parent LinkedList pointer was Null." );
+                }
+
+                this->expectedModCount = this->list->modCount;
+                this->current = &list->tail;
+            }
+
+            virtual ~ReverseIterator() {}
+
+            virtual bool hasNext() const {
+                return this->current->prev != &(this->list->head);
+            }
+
+            virtual E next() {
+
+                if( this->expectedModCount != this->list->modCount ) {
+                    throw ConcurrentModificationException(
+                        __FILE__, __LINE__, "List modified outside of this Iterator." );
+                }
+
+                if( this->current->prev == &(this->list->head) ) {
+                    throw NoSuchElementException(
+                        __FILE__, __LINE__, "No more elements to return from next()" );
+                }
+
+                this->current = this->current->prev;
+                this->canRemove = true;
+
+                return this->current->value;
+            }
+
+            virtual void remove() {
+                if( this->expectedModCount != this->list->modCount ) {
+                    throw ConcurrentModificationException(
+                        __FILE__, __LINE__, "List modified outside of this Iterator." );
+                }
+
+                if( !this->canRemove ) {
+                    throw lang::exceptions::IllegalStateException(
+                        __FILE__, __LINE__,
+                        "Invalid State to call remove, must call next() before remove()" );
+                }
+
+                ListNode<E>* next = this->current->prev;
+                ListNode<E>* prev = this->current->next;
+
+                next->next = prev;
+                prev->prev = next;
+
+                delete this->current;
+
+                this->current = prev;
+
+                this->list->listSize--;
+                this->list->modCount++;
+                this->expectedModCount++;
+                this->canRemove = false;
+            }
+        };
+
+        class ConstReverseIterator : public Iterator<E> {
+        private:
+
+            const LinkedList<E>* list;
+            const ListNode<E>* current;
+
+        public:
+
+            ConstReverseIterator( const LinkedList<E>* list ) :
+                Iterator<E>(), list( list ), current(NULL) {
+
+                if( list == NULL ) {
+                    throw decaf::lang::exceptions::NullPointerException(
+                        __FILE__, __LINE__, "Parent LinkedList pointer was Null." );
+                }
+
+                this->current = &list->tail;
+            }
+
+            virtual ~ConstReverseIterator() {}
+
+            virtual bool hasNext() const {
+                return this->current->prev != &(this->list->head);
+            }
+
+            virtual E next() {
+
+                if( this->current->prev == &(this->list->head) ) {
+                    throw NoSuchElementException(
+                        __FILE__, __LINE__, "No more elements to return from next()" );
+                }
+
+                this->current = this->current->prev;
+
+                return this->current->value;
+            }
+
+            virtual void remove() {
+                throw lang::exceptions::UnsupportedOperationException(
+                    __FILE__, __LINE__, "Cannot write to a const Iterator." );
+            }
+        };
+
+    public:
+
+        using AbstractSequentialList<E>::listIterator;
+
+        virtual ListIterator<E>* listIterator( int index ) {
+            return new LinkedListIterator( this, index );
+        }
+        virtual ListIterator<E>* listIterator( int index ) const {
+            return new ConstLinkedListIterator( this, index );
+        }
+
+        virtual Iterator<E>* descendingIterator() {
+            return new ReverseIterator( this );
+        }
+        virtual Iterator<E>* descendingIterator() const {
+            return new ConstReverseIterator( this );
+        }
+
+    private:
+
+        E removeAtFront() {
+
+            if( this->head.next == &this->tail ) {
+                throw NoSuchElementException(
+                    __FILE__, __LINE__, "The Collection is empty." );
+            }
+
+            ListNode<E>* oldNode = this->head.next;
+            E result = oldNode->value;
+
+            this->head.next = oldNode->next;
+            this->head.next->prev = &this->head;
+
+            delete oldNode;
+
+            this->listSize--;
+            AbstractList<E>::modCount++;
+
+            return result;
+        }
+
+        E removeAtEnd() {
+
+            if( this->head.next == &this->tail ) {
+                throw NoSuchElementException(
+                    __FILE__, __LINE__, "The Collection is empty." );
+            }
+
+            ListNode<E>* oldNode = this->tail.prev;
+            E result = oldNode->value;
+
+            this->tail.prev = oldNode->prev;
+            this->tail.prev->next = &this->tail;
+
+            delete oldNode;
+
+            this->listSize--;
+            AbstractList<E>::modCount++;
+
+            return result;
+        }
+
+        void addToFront( const E& value ) {
+
+            ListNode<E>* newHead = new ListNode<E>( &this->head, this->head.next, value );
+
+            (this->head.next)->prev = newHead;
+            this->head.next = newHead;
+
+            this->listSize++;
+            AbstractList<E>::modCount++;
+        }
+
+        void addToEnd( const E& value ) {
+
+            ListNode<E>* newTail = new ListNode<E>( this->tail.prev, &this->tail, value );
+
+            (this->tail.prev)->next = newTail;
+            this->tail.prev = newTail;
+
+            this->listSize++;
+            AbstractList<E>::modCount++;
+        }
+
+        void addAtLocation( int index, const E& value ) {
+
+            ListNode<E>* location = NULL;
+
+            if( index <= this->listSize / 2 ) {
+                location = this->head.next;
+                for( int i = 0; i < index; ++i ) {
+                    location = location->next;
+                }
+            } else {
+                location = &this->tail;
+                for( int i = this->listSize; i > index; --i ) {
+                    location = location->prev;
+                }
+            }
+
+            ListNode<E>* newNode = new ListNode<E>( location->prev, location, value );
+
+            (location->prev)->next = newNode;
+            location->prev = newNode;
+
+            this->listSize++;
+            AbstractList<E>::modCount++;
+        }
+
+        bool addAllAtLocation( int index, const Collection<E>& collection ) {
+
+            if( index < 0 || index > this->listSize ) {
+                throw decaf::lang::exceptions::IndexOutOfBoundsException(
+                    __FILE__, __LINE__, "Index for add is outside bounds of this LinkedList." );
+            }
+
+            int csize = collection.size();
+            if( csize == 0 ) {
+                return false;
+            }
+
+            std::auto_ptr< ArrayList<E> > copy;
+            std::auto_ptr< Iterator<E> > iter;
+
+            if( (void*)this == &collection ) {
+                copy.reset( new ArrayList<E>( collection ) );
+                iter.reset( copy->iterator() );
+            } else {
+                iter.reset( collection.iterator() );
+            }
+
+            ListNode<E>* newNode = NULL;
+            ListNode<E>* previous = NULL;
+
+            if( index < this->listSize / 2 ) {
+                previous = &this->head;
+                for( int i = 0; i < index; ++i ) {
+                    previous = previous->next;
+                }
+            } else {
+                previous = &this->tail;
+                for( int i = this->listSize; i >= index; --i ) {
+                    previous = previous->prev;
+                }
+            }
+
+            while( iter->hasNext() ) {
+                newNode = new ListNode<E>( previous, previous->next, iter->next() );
+                previous->next->prev = newNode;
+                previous->next = newNode;
+                previous = newNode;
+            }
+
+            this->listSize += csize;
+            AbstractList<E>::modCount++;
+
+            return true;
+        }
+
+        void purgeList() {
+            ListNode<E>* current = this->head.next;
+            ListNode<E>* temp = NULL;
+            while( current != &this->tail ) {
+                temp = current;
+                current = current->next;
+                delete temp;
+            }
+        }
+    };
+
+}}
+
+#endif /* _DECAF_UTIL_LINKEDLIST_H_ */

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/LinkedList.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/List.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/List.cpp?rev=1050221&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/List.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/List.cpp Thu Dec 16 23:18:02 2010
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "List.h"

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/List.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/List.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/List.h?rev=1050221&r1=1050220&r2=1050221&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/List.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/List.h Thu Dec 16 23:18:02 2010
@@ -18,11 +18,12 @@
 #ifndef _DECAF_UTIL_LIST_H_
 #define _DECAF_UTIL_LIST_H_
 
-#include <decaf/lang/exceptions/NoSuchElementException.h>
+#include <decaf/util/NoSuchElementException.h>
 #include <decaf/lang/exceptions/IndexOutOfBoundsException.h>
 #include <decaf/util/concurrent/Synchronizable.h>
 #include <decaf/util/Config.h>
 #include <decaf/util/Iterator.h>
+#include <decaf/util/Collection.h>
 #include <decaf/util/AbstractCollection.h>
 #include <decaf/util/ListIterator.h>
 
@@ -43,10 +44,17 @@ namespace util{
      * to insert them, but we expect this usage to be rare.
      */
     template <typename E>
-    class DECAF_API List : public decaf::util::AbstractCollection<E> {
+    class DECAF_API List : public virtual decaf::util::Collection<E> {
     public:
 
-        List() : AbstractCollection<E>() {}
+        // Un-hide any methods from Collection that the declarations in this interface hid.
+        using decaf::util::Collection<E>::add;
+        using decaf::util::Collection<E>::addAll;
+        using decaf::util::Collection<E>::remove;
+
+    public:
+
+        List() {}
 
         virtual ~List() {}
 
@@ -78,12 +86,15 @@ namespace util{
          * formally, returns the lowest index i such that get(i) == value, or
          * -1 if there is no such index.
          *
-         * @param value - element to search for
-         * @return the index of the first occurrence of the specified element in
-         * this list,
-         * @throw NoSuchElementException if value is not in the list
+         * @param value
+         *      The element to search for in this List.
+         *
+         * @return the index of the first occurrence of the specified element in this list,
+         *
+         * @throws NullPointerException if the Collection is a container of pointers
+         *         and does not allow NULL values.
          */
-        virtual int indexOf( const E& value ) = 0;
+        virtual int indexOf( const E& value ) const = 0;
 
         /**
          * Returns the index of the last occurrence of the specified element in
@@ -91,17 +102,26 @@ namespace util{
          * formally, returns the highest index i such that get(i) == value
          * or -1 if there is no such index.
          *
-         * @param value - element to search for
-         * @return the index of the last occurrence of the specified element in
-         * this list.
-         * @throw NoSuchElementException if value is not in the list
+         * @param value
+         *      The element to search for in this List.
+         *
+         * @return the index of the last occurrence of the specified element in this list.
+         *
+         * @throws NullPointerException if the Collection is a container of pointers
+         *         and does not allow NULL values.
          */
-        virtual int lastIndexOf( const E& value ) = 0;
+        virtual int lastIndexOf( const E& value ) const = 0;
 
         /**
-         * Gets the element contained at position passed
-         * @param index - position to get
-         * @return value at index
+         * Gets the element contained at position passed.
+         *
+         * @param index
+         *      The position to get.
+         *
+         * @return value at index specified.
+         *
+         * @throws IndexOutOfBoundsException if the index given is less than zero
+         *         or greater than the List size.
          */
         virtual E get( int index ) const = 0;
 
@@ -109,10 +129,22 @@ namespace util{
          * Replaces the element at the specified position in this list with the
          * specified element.
          *
-         * @param index - index of the element to replace
-         * @param element - element to be stored at the specified position
-         * @return the element previously at the specified position
-         * @throw IndexOutOfBoundsException - if the index is greater than size
+         * @param index
+         *      The index of the element to replace.
+         * @param element
+         *      The element to be stored at the specified position.
+         *
+         * @return the element previously at the specified position.
+         *
+         * @throws IndexOutOfBoundsException if the index given is less than zero
+         *         or greater than the List size.
+         * @throws UnsupportedOperationExceptio if this is an unmodifiable collection.
+         * @throws NullPointerException if the Collection is a container of pointers
+         *         and does not allow NULL values.
+         * @throws IllegalArgumentException if some property of the element prevents it
+         *         from being added to this collection
+         * @throws IllegalStateException if the element cannot be added at this time due
+         *         to insertion restrictions.
          */
         virtual E set( int index, const E& element ) = 0;
 
@@ -121,11 +153,19 @@ namespace util{
          * Shifts the element currently at that position (if any) and any
          * subsequent elements to the right (adds one to their indices).
          *
-         * @param index - index at which the specified element is to be inserted
-         * @param element - element to be inserted
-         *
-         * @throw IndexOutOfBoundsException - if the index is greater than size
-         * @throw UnsupportedOperationException - If the collection is non-modifiable.
+         * @param index
+         *      The index at which the specified element is to be inserted.
+         * @param element
+         *      The element to be inserted in this List.
+         *
+         * @throws IndexOutOfBoundsException if the index is greater than size of the List.
+         * @throws UnsupportedOperationExceptio if this is an unmodifiable collection.
+         * @throws NullPointerException if the Collection is a container of pointers
+         *         and does not allow NULL values.
+         * @throws IllegalArgumentException if some property of the element prevents it
+         *         from being added to this collection
+         * @throws IllegalStateException if the element cannot be added at this time due
+         *         to insertion restrictions.
          */
         virtual void add( int index, const E& element ) = 0;
 
@@ -146,8 +186,15 @@ namespace util{
          *
          * @return true if this list changed as a result of the call
          *
-         * @throw IndexOutOfBoundsException - if the index is greater than size
-         * @throw UnsupportedOperationException - If the collection is non-modifiable.
+         * @throws IndexOutOfBoundsException if the index given is less than zero
+         *         or greater than the List size.
+         * @throws UnsupportedOperationExceptio if this is an unmodifiable collection.
+         * @throws NullPointerException if the Collection is a container of pointers
+         *         and does not allow NULL values.
+         * @throws IllegalArgumentException if some property of the element prevents it
+         *         from being added to this collection
+         * @throws IllegalStateException if the element cannot be added at this time due
+         *         to insertion restrictions.
          */
         virtual bool addAll( int index, const Collection<E>& source ) = 0;
 
@@ -156,12 +203,15 @@ namespace util{
          * Shifts any subsequent elements to the left (subtracts one from their
          * indices). Returns the element that was removed from the list.
          *
-         * @param index - the index of the element to be removed
-         * @return the element previously at the specified position
-         * @throw IndexOutOfBoundsException - if the index is greater than size
-         * @throw UnsupportedOperationException - If the collection is non-modifiable.
+         * @param index - the index of the element to be removed.
+         *
+         * @return the element previously at the specified position.
+         *
+         * @throws IndexOutOfBoundsException if the index given is less than zero
+         *         or greater than the List size.
+         * @throws UnsupportedOperationExceptio if this is an unmodifiable collection.
          */
-        virtual E remove( int index ) = 0;
+        virtual E removeAt( int index ) = 0;
 
     };
 

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/ListIterator.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/ListIterator.cpp?rev=1050221&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/ListIterator.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/ListIterator.cpp Thu Dec 16 23:18:02 2010
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ListIterator.h"

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/ListIterator.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/ListIterator.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/ListIterator.h?rev=1050221&r1=1050220&r2=1050221&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/ListIterator.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/ListIterator.h Thu Dec 16 23:18:02 2010
@@ -51,11 +51,13 @@ namespace util{
          * element. (This call increases by one the value that would be returned
          * by a call to nextIndex or previousIndex.)
          *
-         * @param e - the element to insert.
-         * @throw UnsupportedOperationException - if the add method is not
-         * supported by this list iterator.
-         * @throw IllegalArgumentException - if some aspect of this element
-         * prevents it from being added to this list.
+         * @param e
+         *      The element to insert into the List.
+         *
+         * @throw UnsupportedOperationException if the add method is not
+         *        supported by this list iterator.
+         * @throw IllegalArgumentException if some aspect of this element
+         *        prevents it from being added to this list.
          */
         virtual void add( const E& e ) = 0;
 
@@ -65,15 +67,17 @@ namespace util{
          * if neither ListIterator.remove nor ListIterator.add have been
          * called after the last call to next or previous.
          *
-         * @param e - the element with which to replace the last element
-         * returned by next or previous.
-         * @throw UnsupportedOperationException - if the add method is not
-         * supported by this list iterator.
-         * @throw IllegalArgumentException - if some aspect of this element
-         * prevents it from being added to this list.
-         * @throw IllegalStateException - if neither next nor previous have been
-         * called, or remove or add have been called after the last call to next
-         * or previous.
+         * @param e
+         *      The element with which to replace the last element returned
+         *      by next or previous.
+         *
+         * @throw UnsupportedOperationException if the add method is not
+         *        supported by this list iterator.
+         * @throw IllegalArgumentException if some aspect of this element
+         *        prevents it from being added to this list.
+         * @throw IllegalStateException if neither next nor previous have been
+         *        called, or remove or add have been called after the last call to next
+         *        or previous.
          */
         virtual void set( const E& e ) = 0;
 
@@ -94,7 +98,8 @@ namespace util{
          * next and previous will return the same element repeatedly.)
          *
          * @return the previous element in the list.
-         * @throw NoSuchElementException - if the iteration has no previous element.
+         *
+         * @throw NoSuchElementException if the iteration has no previous element.
          */
         virtual E previous() = 0;
 
@@ -104,8 +109,8 @@ namespace util{
          * is at the end of the list.)
          *
          * @return the index of the element that would be returned by a
-         * subsequent call to next, or list size if list iterator is at end
-         * of list.
+         *         subsequent call to next, or list size if list iterator is
+         *         at end of list.
          */
         virtual int nextIndex() const = 0;
 
@@ -115,8 +120,8 @@ namespace util{
          * at the beginning of the list.)
          *
          * @return the index of the element that would be returned by a
-         * subsequent call to previous, or -1 if list iterator is at beginning
-         * of list.
+         *         subsequent call to previous, or -1 if list iterator is
+         *         at beginning of list.
          */
         virtual int previousIndex() const = 0;
 

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Map.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Map.cpp?rev=1050221&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Map.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Map.cpp Thu Dec 16 23:18:02 2010
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Map.h"

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Map.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Map.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Map.h?rev=1050221&r1=1050220&r2=1050221&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Map.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/Map.h Thu Dec 16 23:18:02 2010
@@ -21,7 +21,7 @@
 #include <functional>
 #include <vector>
 #include <decaf/lang/exceptions/UnsupportedOperationException.h>
-#include <decaf/lang/exceptions/NoSuchElementException.h>
+#include <decaf/util/NoSuchElementException.h>
 #include <decaf/util/concurrent/Synchronizable.h>
 #include <decaf/util/concurrent/Mutex.h>
 

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/NoSuchElementException.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/NoSuchElementException.cpp?rev=1050221&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/NoSuchElementException.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/NoSuchElementException.cpp Thu Dec 16 23:18:02 2010
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "NoSuchElementException.h"
+
+using namespace decaf;
+using namespace decaf::util;
+
+////////////////////////////////////////////////////////////////////////////////
+NoSuchElementException::NoSuchElementException() throw() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+NoSuchElementException::~NoSuchElementException() throw() {
+}

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/NoSuchElementException.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/NoSuchElementException.h (from r1036929, activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/exceptions/NoSuchElementException.h)
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/NoSuchElementException.h?p2=activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/NoSuchElementException.h&p1=activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/exceptions/NoSuchElementException.h&r1=1036929&r2=1050221&rev=1050221&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/exceptions/NoSuchElementException.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/NoSuchElementException.h Thu Dec 16 23:18:02 2010
@@ -14,14 +14,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef _DECAF_LANG_EXCEPTIONS_NOSUCHELEMENTEXCEPTION_H_
-#define _DECAF_LANG_EXCEPTIONS_NOSUCHELEMENTEXCEPTION_H_
+#ifndef _DECAF_UTIL_NOSUCHELEMENTEXCEPTION_H_
+#define _DECAF_UTIL_NOSUCHELEMENTEXCEPTION_H_
 
-#include <decaf/lang/Exception.h>
+#include <decaf/lang/exceptions/RuntimeException.h>
 
 namespace decaf{
-namespace lang{
-namespace exceptions{
+namespace util{
 
     /*
      * Thrown from an operation that attempts to access some element that does
@@ -29,14 +28,13 @@ namespace exceptions{
      *
      * @since 1.0
      */
-    class DECAF_API NoSuchElementException : public Exception
-    {
+    class DECAF_API NoSuchElementException : public decaf::lang::exceptions::RuntimeException {
     public:
 
         /**
          * Default Constructor
          */
-        NoSuchElementException() throw() {};
+        NoSuchElementException() throw();
 
         /**
          * Conversion Constructor from some other Exception
@@ -44,10 +42,10 @@ namespace exceptions{
          * @param ex
          *      The Exception whose data is to be copied into this one.
          */
-        NoSuchElementException( const Exception& ex ) throw()
-        : Exception()
+        NoSuchElementException( const decaf::lang::exceptions::RuntimeException& ex ) throw()
+        : decaf::lang::exceptions::RuntimeException()
         {
-            *(Exception*)this = ex;
+            *(decaf::lang::exceptions::RuntimeException*)this = ex;
         }
 
         /**
@@ -57,9 +55,9 @@ namespace exceptions{
          *      The Exception whose data is to be copied into this one.
          */
         NoSuchElementException( const NoSuchElementException& ex ) throw()
-        : Exception()
+        : decaf::lang::exceptions::RuntimeException()
         {
-            *(Exception*)this = ex;
+            *(decaf::lang::exceptions::RuntimeException*)this = ex;
         }
 
         /**
@@ -74,7 +72,7 @@ namespace exceptions{
          */
         NoSuchElementException( const char* file, const int lineNumber,
                                 const std::exception* cause,
-                                const char* msg, ... ) throw() : Exception( cause )
+                                const char* msg, ... ) throw() : decaf::lang::exceptions::RuntimeException( cause )
         {
             va_list vargs;
             va_start( vargs, msg );
@@ -89,7 +87,7 @@ namespace exceptions{
          * @param cause Pointer to the exception that caused this one to
          * be thrown, the object is cloned caller retains ownership.
          */
-        NoSuchElementException( const std::exception* cause ) throw() : Exception( cause ) {}
+        NoSuchElementException( const std::exception* cause ) throw() : decaf::lang::exceptions::RuntimeException( cause ) {}
 
         /**
          * Constructor - Initializes the file name and line number where
@@ -103,7 +101,7 @@ namespace exceptions{
         NoSuchElementException( const char* file,
                                 const int lineNumber,
                                 const char* msg, ... ) throw()
-        : Exception()
+        : decaf::lang::exceptions::RuntimeException()
         {
             va_list vargs;
             va_start( vargs, msg );
@@ -124,10 +122,10 @@ namespace exceptions{
             return new NoSuchElementException(*this);
         }
 
-        virtual ~NoSuchElementException() throw() {}
+        virtual ~NoSuchElementException() throw();
 
     };
 
-}}}
+}}
 
-#endif /*_DECAF_LANG_EXCEPTIONS_NOSUCHELEMENTEXCEPTION_H_*/
+#endif /*_DECAF_UTIL_NOSUCHELEMENTEXCEPTION_H_*/

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/PriorityQueue.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/PriorityQueue.cpp?rev=1050221&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/PriorityQueue.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/PriorityQueue.cpp Thu Dec 16 23:18:02 2010
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "PriorityQueue.h"

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/PriorityQueue.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/PriorityQueue.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/PriorityQueue.h?rev=1050221&r1=1050220&r2=1050221&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/PriorityQueue.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/PriorityQueue.h Thu Dec 16 23:18:02 2010
@@ -93,7 +93,7 @@ namespace util {
             virtual E next() {
 
                 if( !hasNext() ) {
-                    throw lang::exceptions::NoSuchElementException(
+                    throw NoSuchElementException(
                         __FILE__, __LINE__,
                         "No more elements to Iterate over." );
                 }
@@ -265,7 +265,7 @@ namespace util {
 
         virtual bool poll( E& result ) {
 
-            if( Queue<E>::isEmpty() ) {
+            if( this->isEmpty() ) {
                 return false;
             }
 
@@ -276,7 +276,7 @@ namespace util {
 
         virtual bool peek( E& result ) const {
 
-            if( Queue<E>::isEmpty() ) {
+            if( this->isEmpty() ) {
                 return false;
             }
 
@@ -286,13 +286,13 @@ namespace util {
 
         virtual E remove() {
 
-            if( !Queue<E>::isEmpty() ) {
+            if( !this->isEmpty() ) {
                 E result = elements[0];
                 removeAt( 0 );
                 return result;
             }
 
-            throw decaf::lang::exceptions::NoSuchElementException(
+            throw decaf::util::NoSuchElementException(
                 __FILE__, __LINE__, "Unable to remove specified element from the Queue." );
         }
 
@@ -368,7 +368,7 @@ namespace util {
             int current = pos;
             int child = 2 * current + 1;
 
-            while( child < _size && !Queue<E>::isEmpty() ) {
+            while( child < _size && !this->isEmpty() ) {
 
                 // compare the children if they exist
                 if( child + 1 < _size && _comparator->compare( elements[child + 1], elements[child] ) < 0 ) {



Mime
View raw message