activemq-cpp-3.4.0

src/main/decaf/util/Collection.h

Go to the documentation of this file.
00001 /*
00002  * Licensed to the Apache Software Foundation (ASF) under one or more
00003  * contributor license agreements.  See the NOTICE file distributed with
00004  * this work for additional information regarding copyright ownership.
00005  * The ASF licenses this file to You under the Apache License, Version 2.0
00006  * (the "License"); you may not use this file except in compliance with
00007  * the License.  You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 #ifndef _DECAF_UTIL_COLLECTION_H_
00019 #define _DECAF_UTIL_COLLECTION_H_
00020 
00021 #include <decaf/util/Config.h>
00022 #include <decaf/lang/exceptions/UnsupportedOperationException.h>
00023 #include <decaf/lang/exceptions/NullPointerException.h>
00024 #include <decaf/lang/exceptions/IllegalArgumentException.h>
00025 #include <decaf/lang/Iterable.h>
00026 #include <decaf/util/Iterator.h>
00027 #include <decaf/util/concurrent/Synchronizable.h>
00028 
00029 namespace decaf{
00030 namespace util{
00031 
00067     template< typename E >
00068     class Collection : public virtual lang::Iterable<E>,
00069                        public virtual util::concurrent::Synchronizable {
00070     public:
00071 
00072         virtual ~Collection() {}
00073 
00084         virtual void copy( const Collection<E>& collection ) = 0;
00085 
00122         virtual bool add( const E& value ) = 0;
00123 
00145         virtual bool addAll( const Collection<E>& collection ) = 0;
00146 
00154         virtual void clear() = 0;
00155 
00169         virtual bool contains( const E& value ) const = 0;
00170 
00181         virtual bool containsAll( const Collection<E>& collection ) const = 0;
00182 
00190         virtual bool equals( const Collection<E>& value ) const = 0;
00191 
00195         virtual bool isEmpty() const = 0;
00196 
00214         virtual bool remove( const E& value ) = 0;
00215 
00231         virtual bool removeAll( const Collection<E>& collection ) = 0;
00232 
00248         virtual bool retainAll( const Collection<E>& collection ) = 0;
00249 
00256         virtual int size() const = 0;
00257 
00269         virtual std::vector<E> toArray() const = 0;
00270 
00271     };
00272 
00273 }}
00274 
00275 #endif /*_DECAF_UTIL_COLLECTION_H_*/