![]() |
Quadcap Embeddable Database |
It's actually implemented as a circular list, with a single head pointer, and the tail is head.prev.
It would be good to have list primitives that worked well moving items from one list to another. moveFront(), in particular, should be able to splice an object out of one list and put it at the front of a different list.
Definition at line 56 of file DList.java.
Public Member Functions | |
| DList () | |
| Construct an empty DList. | |
| void | resize (int newsize) |
| Make the DList a specified size, adding null entries or deleting tail entries. | |
| int | size () |
| Return the number of items in the list. | |
| DListItem | addFront (Object obj) |
| Add an object to the front of the list. | |
| void | addAfter (DListItem d, Object obj) |
| Add an object after an existing list item. | |
| void | addBefore (DListItem d, Object obj) |
| Add an object before an existing list item. | |
| DListItem | addBack (Object obj) |
| Add an object to the back of the list. | |
| DListItem | head () throws ListException |
| Access the object at the front of the list. | |
| DListItem | tail () throws ListException |
| Access the object at the back of the list. | |
| DListItem | popFront () throws ListException |
| Remove and return the item at the front of the list. | |
| DListItem | popBack () throws ListException |
| Remove and return the item at the back of the list. | |
| String | toString () |
| This method returns a string containing the display representation of this list. | |
| void | show (PrintWriter os, String delim) |
| This method displays a list on the specified output stream. | |
| void | show (PrintStream os) |
| This method displays a list using commas as delimiters. | |
| void | show (PrintWriter os) |
| This method displays a list using commas as delimiters. | |
| final void | moveFront (DListItem d) |
| Move the specified item, which is assumed to be already in the list, to the front of this list. | |
| final void | unlink (DListItem d) |
| Enumeration | elements () |
| Return an enumeration of all of the items in this list. | |
Package Functions | |
| final void | addFront (DListItem d) |
| final void | addBack (DListItem d) |
Package Attributes | |
| int | size |
| The number of entries in the list. | |
| DListItem | head |
| The head of the list, null if the list is empty. | |
|
|
Construct an empty DList.
Definition at line 68 of file DList.java. References com.quadcap.util.DList.head, and com.quadcap.util.DList.size. |
|
||||||||||||
|
Add an object after an existing list item.
Definition at line 115 of file DList.java. References com.quadcap.util.DList.addAfter(), com.quadcap.util.DListItem.next, and com.quadcap.util.DListItem.prev. Referenced by com.quadcap.util.DList.addAfter(). |
|
|
Definition at line 271 of file DList.java. References com.quadcap.util.DListItem.next, and com.quadcap.util.DListItem.prev. |
|
|
Add an object to the back of the list.
Definition at line 141 of file DList.java. References com.quadcap.util.DList.addBack(). Referenced by com.quadcap.util.DList.addBack(), and com.quadcap.util.DList.resize(). |
|
||||||||||||
|
Add an object before an existing list item.
Definition at line 129 of file DList.java. References com.quadcap.util.DList.addBefore(), com.quadcap.util.DListItem.next, and com.quadcap.util.DListItem.prev. Referenced by com.quadcap.util.DList.addBefore(). |
|
|
Definition at line 265 of file DList.java. |
|
|
Add an object to the front of the list.
Definition at line 103 of file DList.java. References com.quadcap.util.DList.addFront(). Referenced by com.quadcap.util.DList.addFront(). |
|
|
Return an enumeration of all of the items in this list.
Definition at line 297 of file DList.java. References com.quadcap.util.DList.head, com.quadcap.util.DListItem.next, and com.quadcap.util.DListItem.obj. |
|
|
Access the object at the front of the list. Throw an exception if the list is empty.
Definition at line 153 of file DList.java. |
|
|
Move the specified item, which is assumed to be already in the list, to the front of this list.
Definition at line 252 of file DList.java. References com.quadcap.util.DList.moveFront(), com.quadcap.util.DListItem.next, and com.quadcap.util.DListItem.prev. Referenced by com.quadcap.util.DList.moveFront(). |
|
|
Remove and return the item at the back of the list.
Definition at line 188 of file DList.java. References com.quadcap.util.DListItem.next, com.quadcap.util.DListItem.prev, and com.quadcap.util.DList.unlink(). Referenced by com.quadcap.util.DList.resize(). |
|
|
Remove and return the item at the front of the list.
Definition at line 174 of file DList.java. References com.quadcap.util.DListItem.next, and com.quadcap.util.DList.unlink(). |
|
|
Make the DList a specified size, adding null entries or deleting tail entries.
Definition at line 79 of file DList.java. References com.quadcap.util.DList.addBack(), com.quadcap.util.DList.popBack(), com.quadcap.util.DList.resize(), and com.quadcap.util.DList.size. Referenced by com.quadcap.util.DList.resize(). |
|
|
This method displays a list using commas as delimiters.
Definition at line 238 of file DList.java. |
|
|
This method displays a list using commas as delimiters.
Definition at line 229 of file DList.java. |
|
||||||||||||
|
This method displays a list on the specified output stream.
Definition at line 209 of file DList.java. References com.quadcap.util.DListItem.next, com.quadcap.util.DListItem.obj, and com.quadcap.util.DList.show(). Referenced by com.quadcap.util.DList.show(), and com.quadcap.util.DList.toString(). |
|
|
Return the number of items in the list.
Definition at line 94 of file DList.java. |
|
|
Access the object at the back of the list. Throw an exception if the list is empty.
Definition at line 164 of file DList.java. References com.quadcap.util.DListItem.prev. |
|
|
This method returns a string containing the display representation of this list.
Definition at line 200 of file DList.java. References com.quadcap.util.DList.show(). |
|
|
Definition at line 281 of file DList.java. References com.quadcap.util.DListItem.next, com.quadcap.util.DListItem.prev, and com.quadcap.util.DList.unlink(). Referenced by com.quadcap.util.DList.popBack(), com.quadcap.util.DList.popFront(), and com.quadcap.util.DList.unlink(). |
|
|
The head of the list, null if the list is empty. Also, an indirect pointer to the tail of the list, since the list is linked circularly. Definition at line 63 of file DList.java. Referenced by com.quadcap.util.DList.DList(), and com.quadcap.util.DList.elements(). |
|
|
The number of entries in the list. We are careful to track the size accurately. Definition at line 59 of file DList.java. Referenced by com.quadcap.util.DList.DList(), and com.quadcap.util.DList.resize(). |