activemq-cpp-3.8.2
List.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_LIST_H_
19 #define _DECAF_UTIL_LIST_H_
20 
24 #include <decaf/util/Config.h>
25 #include <decaf/util/Iterator.h>
26 #include <decaf/util/Collection.h>
29 
30 namespace decaf{
31 namespace util{
32 
46  template <typename E>
47  class DECAF_API List : public virtual decaf::util::Collection<E> {
48  public:
49 
50  // Un-hide any methods from Collection that the declarations in this interface hid.
54 
55  public:
56 
57  List() {}
58 
59  virtual ~List() {}
60 
64  virtual ListIterator<E>* listIterator() = 0;
65  virtual ListIterator<E>* listIterator() const = 0;
66 
80  virtual ListIterator<E>* listIterator( int index ) = 0;
81  virtual ListIterator<E>* listIterator( int index ) const = 0;
82 
97  virtual int indexOf( const E& value ) const = 0;
98 
113  virtual int lastIndexOf( const E& value ) const = 0;
114 
126  virtual E get( int index ) const = 0;
127 
149  virtual E set( int index, const E& element ) = 0;
150 
170  virtual void add( int index, const E& element ) = 0;
171 
199  virtual bool addAll( int index, const Collection<E>& source ) = 0;
200 
214  virtual E removeAt( int index ) = 0;
215 
216  };
217 
218 }}
219 
220 #endif /*_DECAF_UTIL_LIST_H_*/
The root interface in the collection hierarchy.
Definition: Collection.h:68
List()
Definition: List.h:57
virtual ~List()
Definition: List.h:59
An iterator for lists that allows the programmer to traverse the list in either direction, modify the list during iteration, and obtain the iterator&#39;s current position in the list.
Definition: ListIterator.h:38
#define DECAF_API
Definition: Config.h:29
An ordered collection (also known as a sequence).
Definition: List.h:47
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: AprPool.h:25