com.antelmann.io
Class ObjectEnumerator
java.lang.Object
com.antelmann.util.AbstractIterator
com.antelmann.io.ObjectEnumerator
- All Implemented Interfaces:
- Enumeration, Iterator
public class ObjectEnumerator
- extends AbstractIterator
used to iterate over (potentially serialized) objects contained in a binary file
or inputstream.
- Author:
- Holger Antelmann
- See Also:
MyFile.objectEnumerator(),
MyFile.objectEnumerator(boolean),
MyFile.objectEnumerator(boolean, Logger)
|
Method Summary |
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. |
| Methods inherited from class com.antelmann.util.AbstractIterator |
allowsNull, currentElement, enumerate, getAll, getCount, getEndCondition, getFilter, hasMoreElements, hasNext, iterate, list, list, next, nextElement, propagatesException, remove, reverseEnumeration, setAllowNull, setFilter, setPropagateException, sortEnumeration, sortEnumeration |
ObjectEnumerator
public ObjectEnumerator(File file,
boolean useDeserialization)
throws IOException
- Throws:
IOException
ObjectEnumerator
public ObjectEnumerator(File file,
boolean useDeserialization,
Logger exceptionLogger)
throws IOException
- Throws:
IOException
ObjectEnumerator
public ObjectEnumerator(InputStream stream,
boolean useDeserialization)
throws IOException
- Throws:
IOException
ObjectEnumerator
public ObjectEnumerator(InputStream stream,
boolean useDeserialization,
Logger exceptionLogger)
throws IOException
- Throws:
IOException
finalize
protected void finalize()
throws IOException
- closes the embedded input stream
- Overrides:
finalize in class Object
- Throws:
IOException
getNextElement
public Object getNextElement()
throws Exception
- Description copied from class:
AbstractIterator
- if no more Element is available, this method is to return null
or throw any Exception.
Errors (as opposed to Exceptions) are not caught, i.e. they would
always be thrown directly and unwrapped during
next().
- Specified by:
getNextElement in class AbstractIterator
- Throws:
Exception
(c) 2001-2006 Holger Antelmann - all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads