105 first->next->prev = first;
160 first->next->prev = first;
183 if (!(iter1.getItem() == iter2.
getItem()))
197 first->next->prev = first;
206 if ( ! first || cmpf( *first->item, t ) > 0 )
208 else if ( cmpf( *
last->item, t ) < 0 )
214 while ( (c = cmpf( *cursor->
item, t )) < 0 )
215 cursor = cursor->
next;
220 cursor = cursor->
prev;
232 if ( ! first || cmpf( *first->item, t ) > 0 )
234 else if ( cmpf( *
last->item, t ) < 0 )
240 while ( (c = cmpf( *cursor->
item, t )) < 0 )
241 cursor = cursor->
next;
243 insf( *cursor->
item, t );
246 cursor = cursor->
prev;
261 first = ( first ) ? first :
last;
269 return ( first == 0 );
281 ASSERT( first,
"List: no item available" );
282 return first->getItem();
311 ASSERT( first,
"List: no item available" );
312 return last->getItem();
330 last->prev->next = 0;
352 T* dummy = cur->
item;
433 ASSERT( current,
"ListIterator: no item available" );
434 return current->getItem();
449 current = current->next;
457 current = current->prev;
465 current = current->next;
473 current = current->prev;
480 current = theList->first;
487 current = theList->last;
496 if ( ! current->prev )
497 theList->insert( t );
500 current->prev =
new ListItem<T>( t, current, current->prev );
501 current->prev->prev->next = current->prev;
513 if ( ! current->next )
514 theList->append( t );
517 current->next =
new ListItem<T>( t, current->next, current );
518 current->next->next->prev = current->next;
530 ListItem <T>*dummynext = current->next, *dummyprev = current->prev;
533 current->prev->next = current->next;
535 current->next->prev = current->prev;
537 theList->last = current->prev;
539 current = ( moveright ) ? dummynext : dummyprev;
545 theList->first = current->
next;
547 current = ( moveright ) ? dummynext : dummyprev;
570 for (
i = F;
i.hasItem();
i++ )
575 while ( ( ! iselt ) &&
j.hasItem() )
577 iselt =
f ==
j.getItem();
592 for (
i = F;
i.hasItem(); ++
i )
593 L.
insert(
i.getItem(), cmpf, insf );
605 for (
i = F;
i.hasItem();
i++ )
610 while ( ( ! iselt ) &&
j.hasItem() )
612 iselt = ecmpf (
f,
j.getItem());
628 for (
i = F;
i.hasItem(); ++
i )
632 for (
j =
G;
j.hasItem() && (!
found); ++
j )
647 for (
i = F;
i.hasItem(); ++
i )
651 for (
j =
G;
j.hasItem() && (!
found); ++
j )
652 found = ecmpf (
f,
j.getItem());
665 for (
i = F;
i.hasItem(); ++
i )
667 found = ecmpf (
G,
i.getItem());
680 for (
i = F;
i.hasItem(); ++
i )
694 for (
i = F;
i.hasItem();
i++ )
702 if (F.
length() == 0)
return false;
716 if (F.
length() == 0)
return false;
#define ASSERT(expression, message)
ListItem< T > * getNext()
ListItem< T > & operator=(const ListItem< T > &)
ListItem(const ListItem< T > &)
ListItem< T > * getPrev()
void remove(int moveright)
ListIterator< T > & operator=(const ListIterator< T > &)
void sort(int(*)(const T &, const T &))
List< T > & operator=(const List< T > &)
void print(OSTREAM &) const
result insert(CFAFactor(LcF, 1, 1))
CFFList append(const CFFList &Inputlist, const CFFactor &TheFactor)
int operator==(const List< T > &l1, const List< T > &l2)
bool find(const List< T > &F, const T &t)
List< T > Union(const List< T > &F, const List< T > &G)
List< T > Difference(const List< T > &F, const List< T > &G)
OSTREAM & operator<<(OSTREAM &os, const List< T > &l)