TUM CCSM Commons

edu.tum.cs.commons.options
Class CommandLineTokenStream

java.lang.Object
  extended by edu.tum.cs.commons.options.CommandLineTokenStream

public class CommandLineTokenStream
extends java.lang.Object

This class preprocesses the command line arguments by splitting them into several tokens. It supports the GNU style syntax as described in CommandLine.

Version:
$Rev: 26283 $
Author:
Benjamin Hummel, $Author: juergens $
Rating:
GREEN Hash: D702FFBA7BE4D5C8637EEE2993924D3B

Constructor Summary
CommandLineTokenStream(java.lang.String[] args)
          Constructs a new CommandLineTokenStream on the given arguments.
 
Method Summary
 boolean hasNext()
          Returns whether a further token is available.
 java.lang.String next()
          Returns the next token as a plain string.
 boolean nextIsFileArgument()
          Returns whether the next token is available and can be used as a file argument.
 boolean nextIsLongOption()
          Returns whether the next token is available and is a long option.
 boolean nextIsParameter()
          Returns whether the next token is available and can be used as a parameter to an option.
 boolean nextIsShortOption()
          Returns whether the next token is available and is a short option.
 java.lang.String nextLongOption()
          Returns the next token as a long option.
 char nextShortOption()
          Returns the next token as a short option.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandLineTokenStream

public CommandLineTokenStream(java.lang.String[] args)
Constructs a new CommandLineTokenStream on the given arguments.

Parameters:
args -
Method Detail

hasNext

public boolean hasNext()
Returns whether a further token is available.


nextIsShortOption

public boolean nextIsShortOption()
Returns whether the next token is available and is a short option.


nextIsLongOption

public boolean nextIsLongOption()
Returns whether the next token is available and is a long option.


nextIsFileArgument

public boolean nextIsFileArgument()
Returns whether the next token is available and can be used as a file argument.


nextIsParameter

public boolean nextIsParameter()
Returns whether the next token is available and can be used as a parameter to an option.


next

public java.lang.String next()
Returns the next token as a plain string.


nextShortOption

public char nextShortOption()
Returns the next token as a short option.


nextLongOption

public java.lang.String nextLongOption()
Returns the next token as a long option.


TUM CCSM Commons

TUM CCSM Commons - 2.7