Holger's
Java API

com.antelmann.io
Class ObjectEnumerator

java.lang.Object
  extended by com.antelmann.util.AbstractIterator
      extended by 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)

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
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
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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
Method Detail

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