public class TransactionListCons extends TransactionList
EMPTY_LIST
Modifier | Constructor and Description |
---|---|
protected |
TransactionListCons(Transaction data,
TransactionList next)
Use the method
TransactionList.prepend for creating
non-empty lists |
Modifier and Type | Method and Description |
---|---|
Transaction |
head() |
boolean |
isEmpty() |
int |
length() |
TransactionList |
tail() |
prepend
protected TransactionListCons(Transaction data, TransactionList next)
TransactionList.prepend
for creating
non-empty listspublic Transaction head()
head
in class TransactionList
this
list, or
null
iff this list is emptypublic TransactionList tail()
tail
in class TransactionList
this
list, or null
iff this list is
emptypublic boolean isEmpty()
isEmpty
in class TransactionList
true
iff this
list is emptypublic int length()
length
in class TransactionList