Package ic211
Class TweetQueue
- java.lang.Object
-
- ic211.TweetQueue
-
public class TweetQueue extends Object
This class provides basic Queue functionality for Tweet objects.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classTweetQueue.IterThis class provides basic iterator functionality to iterate over the elements in the Queue without changing the Queue.
-
Constructor Summary
Constructors Constructor Description TweetQueue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tweetdequeue()Take frontmost value off the Queue and return it.booleanempty()This method is used to determine whether the Queue is empty.voidenqueue(Tweet s)Enqueue (add to back) Tweet into the Queue.protected TweetQueue.Iteriterator()This method returns and iterator set to the initial element of the Queue.
-
-
-
Method Detail
-
enqueue
public void enqueue(Tweet s)
Enqueue (add to back) Tweet into the Queue.- Parameters:
s- The Tweet to be enqueued.
-
dequeue
public Tweet dequeue()
Take frontmost value off the Queue and return it.- Returns:
- Tweet taken off the front of the Queue
-
empty
public boolean empty()
This method is used to determine whether the Queue is empty.- Returns:
- Return true if Queue is empty, false otherwise.
-
iterator
protected TweetQueue.Iter iterator()
This method returns and iterator set to the initial element of the Queue.- Returns:
- An iterator set to the initial element of the Queue
-
-