|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectscranton.Linear1
scranton.Linear1Ind
scranton.list.RecursiveListViaLinear1Ind
A implementation of the RecursiveList paradigm using the Linear1Ind class, the implementation represents an empty list with a "null object".
A RecursiveList is
|
| Field Summary |
| Fields inherited from class scranton.Linear1 |
data, link |
| Constructor Summary | |
RecursiveListViaLinear1Ind()
Constructs a "null object", (null, ()). |
|
RecursiveListViaLinear1Ind(java.lang.Object o)
Constructs a Linear1 object containing o as its head and an empty tail, (o, ()). |
|
| Method Summary | |
Linear1 |
factory()
Returns a null Linear1() object |
java.lang.Object |
headOf()
Returns reference to the Object at the head of the list. |
void |
insert(RecursiveList B)
Replaces the current list with a new list composed by concatenating the current list to the list in the parameter, this = L+this. |
boolean |
isEmpty()
Returns true if the current list is empty. |
RecursiveList |
remove()
If this = (h, T), remove the current list and replace it by its tail, this' = T, return (h, ()). |
RecursiveList |
tailOf()
Returns reference to the tail of the current list. |
java.lang.String |
toString()
Returns a string representation of the list. |
| Methods inherited from class scranton.Linear1Ind |
indInsert, indRemove, indReplace, indView |
| Methods inherited from class scranton.Linear1 |
getData, getLink, setData, setLink |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public RecursiveListViaLinear1Ind()
public RecursiveListViaLinear1Ind(java.lang.Object o)
o - The object to be referenced by this Linear1Ind object.| Method Detail |
public boolean isEmpty()
RecursiveList| Returns this==()? |
isEmpty in interface RecursiveListRecursiveList.isEmpty()public java.lang.Object headOf()
RecursiveList|
this!=()
this' = this = (h,T) Returns h |
headOf in interface RecursiveListpublic RecursiveList tailOf()
RecursiveList|
this!=()
this' = this = (h,T) |
tailOf in interface RecursiveListpublic void insert(RecursiveList B)
RecursiveList| this'= L + this |
insert in interface RecursiveListB - List that will be prepended to this. RecursiveList.insert(scranton.list.RecursiveList)public RecursiveList remove()
RecursiveList|
this!=()
this=(h,T) this'=T Return (h, ()) |
remove in interface RecursiveListpublic java.lang.String toString()
RecursiveList
toString in interface RecursiveListtoString in class Linear1Indpublic Linear1 factory()
Linear1
factory in class Linear1
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||