activemq-cpp-3.6.0
Collection.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _DECAF_UTIL_COLLECTION_H_
19 #define _DECAF_UTIL_COLLECTION_H_
20 
21 #include <decaf/util/Config.h>
25 #include <decaf/lang/Iterable.h>
26 #include <decaf/util/Iterator.h>
28 
29 namespace decaf{
30 namespace util{
31 
67  template< typename E >
68  class Collection : public virtual lang::Iterable<E>,
69  public virtual util::concurrent::Synchronizable {
70  public:
71 
72  virtual ~Collection() {}
73 
84  virtual void copy( const Collection<E>& collection ) = 0;
85 
122  virtual bool add( const E& value ) = 0;
123 
145  virtual bool addAll( const Collection<E>& collection ) = 0;
146 
154  virtual void clear() = 0;
155 
169  virtual bool contains( const E& value ) const = 0;
170 
181  virtual bool containsAll( const Collection<E>& collection ) const = 0;
182 
190  virtual bool equals( const Collection<E>& value ) const = 0;
191 
195  virtual bool isEmpty() const = 0;
196 
214  virtual bool remove( const E& value ) = 0;
215 
231  virtual bool removeAll( const Collection<E>& collection ) = 0;
232 
248  virtual bool retainAll( const Collection<E>& collection ) = 0;
249 
256  virtual int size() const = 0;
257 
269  virtual std::vector<E> toArray() const = 0;
270 
271  };
272 
273 }}
274 
275 #endif /*_DECAF_UTIL_COLLECTION_H_*/