JAPI 0_6-alpha-2
Yet another Java API
API Documentation

net.sf.japi.io
Class ARGVEnumeration

java.lang.Object
  extended by net.sf.japi.io.ARGVEnumeration
All Implemented Interfaces:
Enumeration<InputStream>

public class ARGVEnumeration
extends Object
implements Enumeration<InputStream>

Implementation of Enumeration for ARGV. Used by ARGVInputStream and ARGVReader. This class looks as if it could instead be an Iterator, but it is intended for use with SequenceInputStream.

Author:
Christian Hujer
See Also:
ARGVInputStream, ARGVReader

Constructor Summary
ARGVEnumeration(String... args)
          Create an ARGVEnumeration.
ARGVEnumeration(ThrowableHandler handler, String... args)
          Create an ARGVEnumeration.
 
Method Summary
 void addThrowableHandler(ThrowableHandler handler)
          Register an exception handler.
 String getCurrentFilename()
          Get the name of the current file.
 boolean hasMoreElements()
           
protected  void log(Exception e)
          Log an exception.
 InputStream nextElement()
           
 void removeThrowableHandler(ThrowableHandler handler)
          Unregister an exception handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ARGVEnumeration

public ARGVEnumeration(String... args)
Create an ARGVEnumeration.

Parameters:
args - Command line arguments or some other String array containing 0 or more file names.

ARGVEnumeration

public ARGVEnumeration(ThrowableHandler handler,
                       String... args)
Create an ARGVEnumeration.

Parameters:
handler - ThrowableHandler to add
args - Command line arguments or some other String array containing 0 or more file names.
Method Detail

log

protected void log(Exception e)
Log an exception. Currently does nothing but tell the registered exception handlers to handle the exception.

Parameters:
e - Exception to log

addThrowableHandler

public void addThrowableHandler(ThrowableHandler handler)
Register an exception handler.

Parameters:
handler - New ThrowableHandler

getCurrentFilename

public String getCurrentFilename()
Get the name of the current file.


hasMoreElements

public boolean hasMoreElements()
Specified by:
hasMoreElements in interface Enumeration<InputStream>
See Also:
Enumeration

nextElement

public InputStream nextElement()
Specified by:
nextElement in interface Enumeration<InputStream>
See Also:
Elements returned are InputStreams.

removeThrowableHandler

public void removeThrowableHandler(ThrowableHandler handler)
Unregister an exception handler.

Parameters:
handler - ThrowableHandler to be removed

JAPI
Yet another Java API
API Documentation

© 2005-2006 Christian Hujer. All rights reserved. See copyright