package for generic double linked list
generic type instancieded by Double_List. This is the type which have the to stored elements of Double_List.
throws Empty_List_Exception .
Class for generic double linked list. It includes methods for Add_At_Tail, Add_At_Head, Remove, Get_Data and get the last, next, previous and first element. Empty_List_Exception is thrown, if you access Double_List and Double_List is null. (Use Is_Empty to check it)
private Double_Lists.Internal_List Anchor_First |
Access to first element of Double_List
private Double_Lists.Internal_List Anchor_Last |
Access to last element of Double_List
private Double_Lists.Internal_List Anchor_Cursor |
Pointer to element at cursor of Double_List
Insert Item in the Double_List as first element. This means: Get_Data(First(Double_List, Add_At_Head(Double_List, Item)))=Item. Cursor is anywhere in list, if list is not empty.
Insert Item in the Double_List as last element. This means: Get_Data(Last(Double_List, Add_At_Tail(Double_List, Item)))=Item. Cursor is anywhere in list, if list is not empty.
Returns the element at internal cursor position.
Deletes element at cursor position. Was it the old last one, the old previous one is the new last one and there stands the cursor after Remove. Otherwise the cursor stands at old next one after Remove.
Sets the cursor at first position in Double_List.
Sets the cursor at last position in Double_List.
Sets the cursor at next position in Double_List. To Iterate Double_List forward use the follow algorithm: L: Double_List; E: Data_Element; First(L); -- Set the internal Iterator at first Position while not Is_Empty(L) loop -- Is the Iterator in the List? E:= Get_Data(L); -- do somthing with this datas Next(L); -- Set the internal Iterator at the next Element of List end loop; -- now is the internal Iterator "behind" the List -- GetData(L) should raise a exception First(L); -- fetchs the internal Iterator back in List (here to the -- beginning of the List)
Sets the cursor at previous position in Double_List.
returns true if Double_List has no element and otherwiese false
Deletes given element. If the element is several times in the list, only the first copy is removed.
throws Empty_List_Exception .
Class for generic double linked list. It includes methods for Add_at_Head, Add_At_Tail, Remove, Get_Data and get the next, previous element.
private Double_Lists.Data_Element Data |
Element at current position
private Double_Lists.Internal_List Previous |
Access to previous element of Internal_List
private Double_Lists.Internal_List Next |
Access to next element of Internal_List
Insert Item in the Double_List as first element. This means: Get_Data(First(Double_List, Add_At_Head(Double_List, Item)))=Item. Internal cursor is undefined after this, but stand at the list, if the list is not empty.
Insert Item in the Double_List as last element. This means: Get_Data(Last(Double_List, Add_At_Tail(Double_List, Item)))=Item. internal cursor is undefined after this, but stand at the list, if the list is not empty.
Returns the element at internal cursor position.
Deletes element at cursor position. Was it the old last one, the old previous one is the new last one and there stands the cursor after Remove. Otherwise the cursor stands at old next one after Remove.
Sets the cursor at next position in Double_List.
Sets the cursor at previous position in Double_List.
returns true if Double_List has no element and otherwiese false
returns true if Double_List has next element and otherwiese false
returns true if Double_List has previous element and otherwiese false
Destructor