org.matalon.pagerankhits.dataStructures
Class UrlsQueue
java.lang.Object
org.matalon.pagerankhits.dataStructures.UrlsQueue
- All Implemented Interfaces:
- Queue
- public class UrlsQueue
- extends java.lang.Object
- implements Queue
This class represents a web related queue data structure.
- Author:
- Yonatan Matalon
Field Summary |
private java.util.List |
urls
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
urls
private java.util.List urls
UrlsQueue
public UrlsQueue()
enqueue
public void enqueue(java.lang.Object obj)
throws InvalidParameterException
- Description copied from interface:
Queue
- Adds the given
Object
to the queue.
- Specified by:
enqueue
in interface Queue
- Parameters:
obj
-
- Throws:
InvalidParameterException
- See Also:
Queue.enqueue(java.lang.Object)
dequeue
public java.lang.Object dequeue()
- Description copied from interface:
Queue
- Removes the first (top) Object in the queue.
- Specified by:
dequeue
in interface Queue
- Returns:
- Returns the removed Object.
- See Also:
Queue.dequeue()
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface Queue
- Returns:
- Returns true, it the queue is empty, false otherwise.
- See Also:
Queue.isEmpty()
elementAt
public WebPageProperties elementAt(int index)
throws java.lang.IndexOutOfBoundsException
- Parameters:
index
-
- Returns:
- Returns the web page properties at the given
index
.
- Throws:
java.lang.IndexOutOfBoundsException
getUrlAt
public java.lang.String getUrlAt(int index)
throws java.lang.IndexOutOfBoundsException
- Parameters:
index
-
- Returns:
- Returns the URL at the given
index
.
- Throws:
java.lang.IndexOutOfBoundsException
size
public int size()
- Returns:
- Returns the size of the queue.