activemq-cpp-3.8.2
ListIterator.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_LISTITERATOR_H_
19 #define _DECAF_UTIL_LISTITERATOR_H_
20 
21 #include <decaf/util/Iterator.h>
22 #include <decaf/util/Config.h>
24 
25 namespace decaf{
26 namespace util{
27 
37  template< typename E>
38  class ListIterator : public decaf::util::Iterator<E> {
39  public:
40 
41  virtual ~ListIterator() {}
42 
62  virtual void add( const E& e ) = 0;
63 
82  virtual void set( const E& e ) = 0;
83 
92  virtual bool hasPrevious() const = 0;
93 
104  virtual E previous() = 0;
105 
115  virtual int nextIndex() const = 0;
116 
126  virtual int previousIndex() const = 0;
127 
128  };
129 
130 }}
131 
132 #endif /*_DECAF_UTIL_LISTITERATOR_H_*/
virtual int previousIndex() const =0
Returns the index of the element that would be returned by a subsequent call to previous.
An iterator for lists that allows the programmer to traverse the list in either direction, modify the list during iteration, and obtain the iterator's current position in the list.
Definition: ListIterator.h:38
Defines an object that can be used to iterate over the elements of a collection.
Definition: Iterator.h:34
virtual void add(const E &e)=0
Inserts the specified element into the list (optional operation).
virtual ~ListIterator()
Definition: ListIterator.h:41
virtual E previous()=0
Returns the previous element in the list.
virtual bool hasPrevious() const =0
Returns true if this list iterator has more elements when traversing the list in the reverse directio...
virtual int nextIndex() const =0
Returns the index of the element that would be returned by a subsequent call to next.
virtual void set(const E &e)=0
Replaces the last element returned by next or previous with the specified element (optional operation...
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: AprPool.h:25