com.opera.core.systems.arguments.interfaces
Interface OperaArguments

All Superinterfaces:
Iterable<OperaArgument>
All Known Implementing Classes:
OperaArguments, OperaCoreArguments, OperaDesktopArguments

public interface OperaArguments
extends Iterable<OperaArgument>

Defines a joint interface for interacting with arguments to various kinds of Operas. OperaArguments represents a command-line argument list and contains individual arguments represented by OperaArgument's.

Author:
Andreas Tolf Tolfsen
See Also:
, com.opera.core.systems.runner.arguments.OperaCoreArguments, OperaArgument

Method Summary
 void add(OperaArgument argument)
          Adds a new argument to the command-line argument list representation.
 void add(String argument)
          Adds a new argument to the command-line argument list representation.
 void add(String argument, String value)
          Adds a new argument with a value to the command-line argument list representation.
 OperaArgument get(int index)
          Convenience method to access the given indexed argument in the command-line list representation.
 List<OperaArgument> getArguments()
          Gets the list of all arguments, each represented by OperaArgument.
 List<String> getArgumentsAsStringList()
          Gets all arguments as a string list, including the argument's values.
 Iterator<OperaArgument> iterator()
          Gets an iterator for all arguments present in this collection.
 OperaArguments merge(OperaArguments extraArguments)
          Merge this command-line list representation with another representation.
 String sign()
          Gets the command-line argument sign used by this implementation of OperaArguments.
 int size()
          Fetches the number of arguments in the command-line list representation.
 String toString()
          Gets the string representation of the command-line, as it would be used externally.
 

Method Detail

add

void add(String argument)
Adds a new argument to the command-line argument list representation. A new OperaArgument will be created with an empty value.

Parameters:
argument - the argument key to add

add

void add(String argument,
         String value)
Adds a new argument with a value to the command-line argument list representation. A new OperaArgument will be created with specified value.

Parameters:
argument - the argument key to add
value - the value the argument should hold

add

void add(OperaArgument argument)
Adds a new argument to the command-line argument list representation. The OperaArgument can optionally hold a value.

Parameters:
argument - the argument to add

get

OperaArgument get(int index)
Convenience method to access the given indexed argument in the command-line list representation. This maps to OperaArguments.getArguments().get(x).

Parameters:
index - the argument to fetch
Returns:
an argument

getArguments

List<OperaArgument> getArguments()
Gets the list of all arguments, each represented by OperaArgument.

Returns:
list of all arguments

iterator

Iterator<OperaArgument> iterator()
Gets an iterator for all arguments present in this collection.

Specified by:
iterator in interface Iterable<OperaArgument>
Returns:
iterator of all arguments

getArgumentsAsStringList

List<String> getArgumentsAsStringList()
Gets all arguments as a string list, including the argument's values.

Returns:
list of all arguments, including values

toString

String toString()
Gets the string representation of the command-line, as it would be used externally.

Overrides:
toString in class Object
Returns:
full command-line including argument keys and values

size

int size()
Fetches the number of arguments in the command-line list representation. Convenience method for OperaArguments.getArguments().size().

Returns:
number of arguments (not including values)

merge

OperaArguments merge(OperaArguments extraArguments)
Merge this command-line list representation with another representation. Note that this will alter the state of the current object as it does not return a new OperaArguments object.

Parameters:
extraArguments - the OperaArguments to merge into this
Returns:
a reference to self

sign

String sign()
Gets the command-line argument sign used by this implementation of OperaArguments. Depending on which implementation (OperaCoreArguments, OperaDesktopArguments) you are using, you will get a OperaArgument.OperaArgumentSign.

Returns:
a command-line argument sign
See Also:
OperaArgument.OperaArgumentSign


Copyright © 2012. All Rights Reserved.