|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.util.AbstractIterator<Object>
com.antelmann.io.ObjectEnumerator
public class ObjectEnumerator
used to iterate over (potentially serialized) objects contained in a binary file or InputStream. If deserialization is enabled, the ObjectEnumerator automatically attempts to convert a discovered byte array into an Object via deserialization.
MyFile.objectEnumerator(),
MyFile.objectEnumerator(boolean),
MyFile.objectEnumerator(boolean, Logger)| Constructor Summary | |
|---|---|
ObjectEnumerator(File file,
boolean useDeserialization)
|
|
ObjectEnumerator(File file,
boolean useDeserialization,
Logger exceptionLogger)
|
|
ObjectEnumerator(InputStream stream,
boolean useDeserialization)
|
|
ObjectEnumerator(InputStream stream,
boolean useDeserialization,
Logger exceptionLogger)
|
|
| Method Summary | |
|---|---|
void |
close()
closes this iterator by calling AbstractIterator.stopIteration(). |
protected void |
finalize()
closes the embedded input stream |
Object |
getNextElement()
if no more Element is available, this method is to return null or throw any Exception. |
ObjectInputStream |
getStream()
provides direct access to the embedded stream in use |
| Methods inherited from class com.antelmann.util.AbstractIterator |
|---|
allowsNull, asIterable, concat, concat, convert, convert, count, currentElement, emptyEnumeration, emptyIterable, emptyIterator, enumerate, filter, filter, getAll, getCount, getEndCondition, getFilter, hasMoreElements, hasNext, iterate, iterate, iterator, list, list, list, list, monitor, monitor, next, nextElement, process, process, propagatesException, remove, reverseEnumeration, setAllowNull, setFilter, setPropagateException, sortEnumeration, sortEnumeration, stopIteration |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ObjectEnumerator(File file,
boolean useDeserialization)
throws IOException
IOException
public ObjectEnumerator(File file,
boolean useDeserialization,
Logger exceptionLogger)
throws IOException
IOException
public ObjectEnumerator(InputStream stream,
boolean useDeserialization)
throws IOException
IOException
public ObjectEnumerator(InputStream stream,
boolean useDeserialization,
Logger exceptionLogger)
throws IOException
IOException| Method Detail |
|---|
public ObjectInputStream getStream()
public void close()
throws IOException
AbstractIteratorAbstractIterator.stopIteration().
You can use this method to clean up any resources there may be needed for this iterator.
Note, however, that this method is not called automatically;
so if you need this method to be called after the iteration is through (or only partially used),
you have to call this method yourself (or you overwrite this implementation accordingly).
Also, when overriding this method, you should call super.close().
close in interface Closeableclose in class AbstractIterator<Object>IOException
protected void finalize()
throws IOException
finalize in class ObjectIOException
public Object getNextElement()
throws Exception
AbstractIteratornext().
getNextElement in class AbstractIterator<Object>Exception
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||