Package ic211
Class TweetQueue.Iter
- java.lang.Object
-
- ic211.TweetQueue.Iter
-
- Enclosing class:
- TweetQueue
protected class TweetQueue.Iter extends Object
This class provides basic iterator functionality to iterate over the elements in the Queue without changing the Queue. The intent is to provide flexibility for adding more functionality through inheritance.
-
-
Constructor Summary
Constructors Constructor Description Iter(ic211.TweetQueue.Node start)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()This method is used to determine whether the iterator has reached the end of the Queue.Tweetnext()Returns the next Tweet in the Queue.
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
This method is used to determine whether the iterator has reached the end of the Queue.- Returns:
- true if the iterator has not reached the end of the Queue
-
next
public Tweet next()
Returns the next Tweet in the Queue. Note: this means calling it consecutively generally gives different results.- Returns:
- the next Tweet in the Queue
-
-