org.archive.queue
Class DiskQueueIterator
java.lang.Object
org.archive.queue.DiskQueueIterator
- All Implemented Interfaces:
- java.util.Iterator
public class DiskQueueIterator
- extends java.lang.Object
- implements java.util.Iterator
An iterator for DiskQueue. It iterates through items queued up in a file.
Does this without changing the file. As a result the remove
method does nothing.
- Author:
- Kristinn Sigurdsson
|
Field Summary |
(package private) java.io.InputStream |
inStream
|
(package private) long |
length
|
(package private) java.io.ObjectInputStream |
objectInStream
|
|
Constructor Summary |
DiskQueueIterator(java.io.InputStream inStream,
long length)
Constructor |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
inStream
java.io.InputStream inStream
objectInStream
java.io.ObjectInputStream objectInStream
length
long length
DiskQueueIterator
public DiskQueueIterator(java.io.InputStream inStream,
long length)
throws java.io.IOException
- Constructor
- Parameters:
inStream - InputStream containing serialized objectslength - The number of items in the stream. If this number is too
large, the hasNext will falsely return true
when we reach the end of the queue and the next call to
next will result in an exception being thrown.
If the number is too small hasNext will return
false while there are still items in the queue.
- Throws:
java.io.IOException
remove
public void remove()
- Not supported
- Specified by:
remove in interface java.util.Iterator
- Throws:
java.lang.UnsupportedOperationException - if invoked
hasNext
public boolean hasNext()
- Specified by:
hasNext in interface java.util.Iterator
next
public java.lang.Object next()
- Specified by:
next in interface java.util.Iterator
Copyright © 2003-2005 Internet Archive. All Rights Reserved.