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_LIST_H_ 00019 #define _DECAF_UTIL_LIST_H_ 00020 00021 #include <decaf/util/NoSuchElementException.h> 00022 #include <decaf/lang/exceptions/IndexOutOfBoundsException.h> 00023 #include <decaf/util/concurrent/Synchronizable.h> 00024 #include <decaf/util/Config.h> 00025 #include <decaf/util/Iterator.h> 00026 #include <decaf/util/Collection.h> 00027 #include <decaf/util/AbstractCollection.h> 00028 #include <decaf/util/ListIterator.h> 00029 00030 namespace decaf{ 00031 namespace util{ 00032 00046 template <typename E> 00047 class DECAF_API List : public virtual decaf::util::Collection<E> { 00048 public: 00049 00050 // Un-hide any methods from Collection that the declarations in this interface hid. 00051 using decaf::util::Collection<E>::add; 00052 using decaf::util::Collection<E>::addAll; 00053 using decaf::util::Collection<E>::remove; 00054 00055 public: 00056 00057 List() {} 00058 00059 virtual ~List() {} 00060 00064 virtual ListIterator<E>* listIterator() = 0; 00065 virtual ListIterator<E>* listIterator() const = 0; 00066 00080 virtual ListIterator<E>* listIterator( int index ) = 0; 00081 virtual ListIterator<E>* listIterator( int index ) const = 0; 00082 00097 virtual int indexOf( const E& value ) const = 0; 00098 00113 virtual int lastIndexOf( const E& value ) const = 0; 00114 00126 virtual E get( int index ) const = 0; 00127 00149 virtual E set( int index, const E& element ) = 0; 00150 00170 virtual void add( int index, const E& element ) = 0; 00171 00199 virtual bool addAll( int index, const Collection<E>& source ) = 0; 00200 00214 virtual E removeAt( int index ) = 0; 00215 00216 }; 00217 00218 }} 00219 00220 #endif /*_DECAF_UTIL_LIST_H_*/
1.6.1