class IntLinkedList extends Object
Modifier and Type | Field and Description |
---|---|
private IntListNode |
head |
private IntListNode |
iterator |
private IntListNode |
tail |
Constructor and Description |
---|
IntLinkedList()
Constructs an empty IntLinkedList.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int val)
Adds the given float to the end of the list.
|
boolean |
hasNext()
Checks if there are more elements for the iterator.
|
int |
nextInt()
Returns the next float in the list, advances the iterator.
|
void |
resetIterator()
Moves the iterator to point to the front of the list.
|
private IntListNode head
private IntListNode tail
private IntListNode iterator
public IntLinkedList()
public void add(int val)
val
- the float to addpublic void resetIterator()
public int nextInt()
hasNext()
method MUST be called before calling
this method to check if the iterator is point to null,
otherwise NullPointerException will be thrown.public boolean hasNext()
true
if there are more elements;
otherwise false
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses