HTTPClient
Class LinkedList
java.lang.Object
|
+--HTTPClient.LinkedList
- class LinkedList
- extends java.lang.Object
This class implements a singly linked list.
| Type | Method |
void |
addToEnd(java.lang.Object elem)
Add the specified element to the end of the list. |
void |
addToHead(java.lang.Object elem)
Add the specified element to the head of the list. |
java.lang.Object |
enumerate()
Starts an enumeration of all the elements in this list. |
java.lang.Object |
getFirst()
Return the first element in the list. |
static void |
main(java.lang.String[] args)
|
java.lang.Object |
next()
Gets the next element in the enumeration. |
void |
remove(java.lang.Object elem)
Remove the specified element from the list. |
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LinkedList
LinkedList()
addToHead
public void addToHead(java.lang.Object elem)
- Add the specified element to the head of the list.
- Parameters:
elem - the object to add to the list.
addToEnd
public void addToEnd(java.lang.Object elem)
- Add the specified element to the end of the list.
- Parameters:
elem - the object to add to the list.
remove
public void remove(java.lang.Object elem)
- Remove the specified element from the list. Does nothing if the element
is not in the list.
- Parameters:
elem - the object to remove from the list.
getFirst
public java.lang.Object getFirst()
- Return the first element in the list. The list is not modified in any
way.
- Returns:
- the first element
enumerate
public java.lang.Object enumerate()
- Starts an enumeration of all the elements in this list. Note that only
one enumeration can be active at any time.
- Returns:
- the first element, or null if the list is empty
next
public java.lang.Object next()
- Gets the next element in the enumeration. The enumeration must have
been first initalized with a call to
enumerate().
- Returns:
- the next element, or null if none left
- See Also:
enumerate()
main
public static void main(java.lang.String[] args)
throws java.lang.Exception