activemq-cpp-3.9.5
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>
29
30namespace decaf {
31namespace 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
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_*/
List()
Definition List.h:57
virtual void add(int index, const E &element)=0
Inserts the specified element at the specified position in this list.
virtual bool addAll(int index, const Collection< E > &source)=0
Inserts all of the elements in the specified collection into this list at the specified position (opt...
The root interface in the collection hierarchy.
Definition Collection.h:69
virtual bool remove(const E &value)=0
Removes a single instance of the specified element from the collection.
virtual ListIterator< E > * listIterator(int index) const =0
virtual E set(int index, const E &element)=0
Replaces the element at the specified position in this list with the specified element.
virtual ListIterator< E > * listIterator()=0
virtual ListIterator< E > * listIterator(int index)=0
virtual E removeAt(int index)=0
Removes the element at the specified position in this list.
virtual ListIterator< E > * listIterator() const =0
virtual E get(int index) const =0
Gets the element contained at position passed.
virtual int indexOf(const E &value) const =0
Returns the index of the first occurrence of the specified element in this list, or -1 if this list d...
List()
Definition List.h:57
virtual void add(int index, const E &element)=0
Inserts the specified element at the specified position in this list.
virtual ~List()
Definition List.h:59
virtual bool addAll(int index, const Collection< E > &source)=0
Inserts all of the elements in the specified collection into this list at the specified position (opt...
virtual int lastIndexOf(const E &value) const =0
Returns the index of the last occurrence of the specified element in this list, or -1 if this list do...
An iterator for lists that allows the programmer to traverse the list in either direction,...
Definition ListIterator.h:38
#define DECAF_API
Definition Config.h:29
Definition AbstractCollection.h:33
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition AprPool.h:25