Class mheg5.UTL.List
All Packages Class Hierarchy This Package Previous Next Index
Class mheg5.UTL.List
java.lang.Object
|
+----mheg5.UTL.List
- public class List
- extends Object
- implements Iterator, Cloneable
-
List()
- Constructor of the List
(using default initial size and default extension size )
-
List(int)
- Constructor of List with start size
-
List(int, int)
- Constructor of the list with start size an extension size
-
Append(ListNode)
- method to Append a ListNode object at the end of the list
-
Clear()
- method to remove all objects from the list
-
Delete(ListNode)
- method to Delete a ListNode object from the list
-
GetHead()
- method to get the head ListNode
-
GetNext(ListNode)
- method to get the ListNode after ln
-
GetPrev(ListNode)
- method to get the ListNode before ln
-
getSize()
-
-
GetTail()
- method to get the tail ListNode
-
InitIteration()
- Initialize regular iteration over the elements of an ordered structure
-
InitIterationReverse()
- Initialize reverse iteration over the elements of an ordered structure
-
InsertAfter(ListNode, ListNode)
- method to Insert a ListNode ln after ListNode after
-
InsertBefore(ListNode, ListNode)
- method to Insert a ListNode ln after ListNode before
-
IsElement(ListNode)
- method to check if ListNode ln is an item of the list
-
NextIteration()
- Iteration over the elements of a structure
-
Prepend(ListNode)
- method to Prepend a ListNode object at the end of the list
-
toString()
- overloading of the Object.toString function
List
public List()
- Constructor of the List
(using default initial size and default extension size )
- Returns:
- an instance of List
List
public List(int startSize)
- Constructor of List with start size
- Parameters:
- startSize - (the initial size of the preallocated for listobjects)
- Returns:
- an instance of List
List
public List(int startSize,
int extSize)
- Constructor of the list with start size an extension size
- Parameters:
- startSize - ( the initial size of the preallocated space
for listobjects)
- extSize - ( the increasement of the space in the underlying
array implementation )
- Returns:
- an instance of List
getSize
public int getSize()
Append
public void Append(ListNode ln)
- method to Append a ListNode object at the end of the list
- Parameters:
- ln - ( the object to append )
Prepend
public void Prepend(ListNode ln)
- method to Prepend a ListNode object at the end of the list
- Parameters:
- ln - ( the object to prepend )
InsertAfter
public void InsertAfter(ListNode ln,
ListNode after)
- method to Insert a ListNode ln after ListNode after
- Parameters:
- ln - ( the object to insert )
- after - ( the object after to insert )
InsertBefore
public void InsertBefore(ListNode ln,
ListNode before)
- method to Insert a ListNode ln after ListNode before
- Parameters:
- ln - ( the object to insert )
- before - ( the object before to insert )
Delete
public void Delete(ListNode ln)
- method to Delete a ListNode object from the list
- Parameters:
- ln - ( the ListNode to be deleted )
GetNext
public ListNode GetNext(ListNode ln)
- method to get the ListNode after ln
- Parameters:
- ln - the next listnode to get
- Returns:
- ListNode ( ln if exists, else null )
GetPrev
public ListNode GetPrev(ListNode ln)
- method to get the ListNode before ln
- Parameters:
- ln - the pre listnode to get
- Returns:
- ListNode ( ln if exists, else null )
GetHead
public ListNode GetHead()
- method to get the head ListNode
- Returns:
- ListNode ( ln if exists, else null )
GetTail
public ListNode GetTail()
- method to get the tail ListNode
- Returns:
- ListNode ( ln if exists, else null )
IsElement
public boolean IsElement(ListNode ln)
- method to check if ListNode ln is an item of the list
- Parameters:
- ln - ( the node to check )
- Returns:
- true if ln is in the List, false else
Clear
public void Clear()
- method to remove all objects from the list
InitIteration
public void InitIteration()
- Initialize regular iteration over the elements of an ordered structure
InitIterationReverse
public void InitIterationReverse()
- Initialize reverse iteration over the elements of an ordered structure
NextIteration
public Object NextIteration()
- Iteration over the elements of a structure
- Returns:
- Object (the next object of the iteration or null )
toString
public String toString()
- overloading of the Object.toString function
- Returns:
- returns the textual representation of the list
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index