uk.ac.ncl.cs.instantsoap.commandlineprocessor.commandLine
Class CommandLine<Value>

java.lang.Object
  extended by uk.ac.ncl.cs.instantsoap.commandlineprocessor.commandLine.CommandLine<Value>

public class CommandLine<Value>
extends Object

The data needed to construct a command-line.

Command-line templates are typically parameterised over variables where as concrete command-lines are parameterised over strings.

Author:
Matthew Pocock

Constructor Summary
CommandLine()
          Create a new instance with an empty list of arguments and a null executable and working directory.
CommandLine(String workingDirectory, String executable, Argument<Value>... arguments)
          Create a new instance with the specified property values.
CommandLine(String workingDirectory, String executable, List<Argument<Value>> arguments)
          Create a new instance with the specified property values.
 
Method Summary
 void addArgument(Argument<Value> argument)
          Add an argument to the end of the arguments list.
 boolean equals(Object o)
           
 List<Argument<Value>> getArguments()
          Get the arguments list.
 String getExecutable()
          Get the name of the executable.
 String getWorkingDirectory()
          Get the working directory that the application will run relative to.
 int hashCode()
           
 void removeArgument(Argument<Value> argument)
          Remove the first occurance of an argument from the arguments list.
 void setArguments(List<Argument<Value>> arguments)
          Set the arguments list.
 void setExecutable(String executable)
          Set the name of the executable.
 void setWorkingDirectory(String workingDirectory)
          Set the working directory that the application will run relative to.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CommandLine

public CommandLine()
Create a new instance with an empty list of arguments and a null executable and working directory.


CommandLine

public CommandLine(String workingDirectory,
                   String executable,
                   List<Argument<Value>> arguments)
Create a new instance with the specified property values.

Parameters:
workingDirectory - the working directory for the excutable
executable - the name of the executable to run
arguments - a List of Arguments

CommandLine

public CommandLine(String workingDirectory,
                   String executable,
                   Argument<Value>... arguments)
Create a new instance with the specified property values.

Parameters:
workingDirectory - the working directory for the excutable
executable - the name of the executable to run
arguments - Arguments for the command line
Method Detail

getWorkingDirectory

public String getWorkingDirectory()
Get the working directory that the application will run relative to.

Returns:
the working directory name

setWorkingDirectory

public void setWorkingDirectory(String workingDirectory)
Set the working directory that the application will run relative to.

Parameters:
workingDirectory - the new working directory name

getExecutable

public String getExecutable()
Get the name of the executable. This may be relative to the working directory, in the path, or absolute.

Returns:
the executable name

setExecutable

public void setExecutable(String executable)
Set the name of the executable.

Parameters:
executable - the name of the executable

getArguments

public List<Argument<Value>> getArguments()
Get the arguments list.

Returns:
the List of Arguments defining this command-line

setArguments

public void setArguments(List<Argument<Value>> arguments)
Set the arguments list.

Parameters:
arguments - the new List of Arguments

addArgument

public void addArgument(Argument<Value> argument)
Add an argument to the end of the arguments list.

Parameters:
argument - the Argument to add

removeArgument

public void removeArgument(Argument<Value> argument)
Remove the first occurance of an argument from the arguments list.

Parameters:
argument - the Argument to remove

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2006-2008. All Rights Reserved.