18 #ifndef _DECAF_UTIL_ABSTRACTSEQUENTIALLIST_H_
19 #define _DECAF_UTIL_ABSTRACTSEQUENTIALLIST_H_
58 template<
typename E >
85 __FILE__, __LINE__,
"Abstract sequential list does not implement the listIterator." );
89 __FILE__, __LINE__,
"Abstract sequential list does not implement the listIterator." );
99 virtual E
get(
int index )
const {
102 std::auto_ptr< ListIterator<E> > iter( this->
listIterator( index ) );
106 __FILE__, __LINE__,
"get called with invalid index." );
117 virtual E
set(
int index,
const E& element ) {
120 std::auto_ptr< ListIterator<E> > iter( this->
listIterator( index ) );
121 E result = iter->next();
122 iter->set( element );
126 __FILE__, __LINE__,
"set called with invalid index." );
137 virtual void add(
int index,
const E& element ) {
140 std::auto_ptr< ListIterator<E> > iter( this->
listIterator( index ) );
141 iter->add( element );
144 __FILE__, __LINE__,
"add called with invalid index." );
159 std::auto_ptr< ListIterator<E> > iter( this->
listIterator( index ) );
160 std::auto_ptr< Iterator<E> > srcIter( source.
iterator() );
161 int next = iter->nextIndex();
162 while( srcIter->hasNext() ) {
163 iter->add( srcIter->next() );
165 return next != iter->nextIndex();
177 std::auto_ptr< ListIterator<E> > iter( this->
listIterator( index ) );
178 E result = iter->next();
183 __FILE__, __LINE__,
"set called with invalid index." );