|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectlinkedLists.IntList
public class IntList
Constructor Summary | |
---|---|
IntList()
Default constructor that creates an empty list |
|
IntList(IntNode n)
constructor to create a list with head node n |
Method Summary | |
---|---|
void |
addFirst(IntNode n)
add a new node at front of list |
void |
addValue(java.lang.Integer i)
add node to front of list containing a given value |
void |
addValueInOrder(java.lang.Integer i)
Add new value in non-decreasing order into list |
IntNode |
delete(int v)
delete all nodes containing the value v from list and return the head of the list |
IntNode |
delete0()
delete the first node containing 0 from list and return the head of the list |
IntNode |
getHead()
return the head of the list |
boolean |
inList(int i)
is Node containing i in list? |
boolean |
isEmpty()
is the list empty? |
void |
removeFirst()
remove node from front of list |
void |
removeValue(int i)
remove all nodes containing element with a given value |
void |
setHead(IntNode n)
set the head of the list |
int |
size()
return size of list |
int |
sum()
returns the sum of the elements list, recursive |
java.lang.String |
toString()
String representation of list, recursive |
void |
writePos()
output positive elements of list |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IntList()
public IntList(IntNode n)
Method Detail |
---|
public IntNode getHead()
public void setHead(IntNode n)
public boolean isEmpty()
public void addFirst(IntNode n)
public void removeFirst()
public void addValue(java.lang.Integer i)
public boolean inList(int i)
public void addValueInOrder(java.lang.Integer i)
public void removeValue(int i)
public void writePos()
public IntNode delete0()
public IntNode delete(int v)
public int size()
public int sum()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |