org.expasy.jpl.commons.app
Class InteractiveInputScannerImpl

java.lang.Object
  extended by org.expasy.jpl.commons.app.InteractiveInputScannerImpl
All Implemented Interfaces:
InteractiveInputScanner

public final class InteractiveInputScannerImpl
extends Object
implements InteractiveInputScanner


Nested Class Summary
static class InteractiveInputScannerImpl.Builder
           
 
Field Summary
static Pattern YES_NO_PATTERN
           
 
Constructor Summary
InteractiveInputScannerImpl(InteractiveInputScannerImpl.Builder builder)
           
 
Method Summary
 String getDefaultInput()
           
 Pattern getExitPattern()
          Get the pattern matching the interruption
 Pattern getInputPattern()
          Get the pattern matching the input
 String getPrompt()
          Get the command-line prompt
 void setInputStream(InputStream stream)
          Set input stream from where input is find (stdin by default)
 void setOutputStream(OutputStream stream)
          Set output stream to where prompt flushed (stdout by default)
 String waitInput()
          Read input stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

YES_NO_PATTERN

public static final Pattern YES_NO_PATTERN
Constructor Detail

InteractiveInputScannerImpl

public InteractiveInputScannerImpl(InteractiveInputScannerImpl.Builder builder)
Method Detail

setInputStream

public void setInputStream(InputStream stream)
Description copied from interface: InteractiveInputScanner
Set input stream from where input is find (stdin by default)

Specified by:
setInputStream in interface InteractiveInputScanner

setOutputStream

public void setOutputStream(OutputStream stream)
Description copied from interface: InteractiveInputScanner
Set output stream to where prompt flushed (stdout by default)

Specified by:
setOutputStream in interface InteractiveInputScanner

waitInput

public String waitInput()
                 throws IOException
Description copied from interface: InteractiveInputScanner
Read input stream

Specified by:
waitInput in interface InteractiveInputScanner
Throws:
IOException

getInputPattern

public Pattern getInputPattern()
Description copied from interface: InteractiveInputScanner
Get the pattern matching the input

Specified by:
getInputPattern in interface InteractiveInputScanner

getPrompt

public String getPrompt()
Description copied from interface: InteractiveInputScanner
Get the command-line prompt

Specified by:
getPrompt in interface InteractiveInputScanner

getExitPattern

public Pattern getExitPattern()
Description copied from interface: InteractiveInputScanner
Get the pattern matching the interruption

Specified by:
getExitPattern in interface InteractiveInputScanner

getDefaultInput

public String getDefaultInput()
Specified by:
getDefaultInput in interface InteractiveInputScanner


Copyright (c) 2012 Swiss Institute of Bioinformatics. All rights reserved.