csc241.samples.stringList
Class stringLinkedList
java.lang.Object
|
+--csc241.samples.stringList.stringLinkedList
- Direct Known Subclasses:
- sortableStringLinkedList
- public class stringLinkedList
- extends java.lang.Object
~mohammad/public_html/classes/csc241/stringList/stringList.java
This an ADT for List class. To make instruction at this point
of the semester easier, this List only holds Strings. Strings can be
compared for equal, less, or more. Objects can be compared,
but at the level of the Object class, we can only determine if they
have the same reference (i.e. they are the same objects). With
lists, we like to be able to compare contents not refernces (i.e.
what the object holds rather than where it is).
It should be clear that a List should be implementable with
arrays and linked list. So, here we have only looking at the LinkedList
implementation.
This implementation uses a header to reference the start of the list.
Access to any stringLinkedList object is through a stringLinkedListItr.
Method Summary |
boolean |
isEmpty()
Test for empty. |
void |
makeEmpty()
Make the list logically empty. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
stringLinkedList
public stringLinkedList()
- Construct the list
isEmpty
public boolean isEmpty()
- Test for empty.
- Returns:
- true if empty, false otherwise.
makeEmpty
public void makeEmpty()
- Make the list logically empty.