/**
* Get a PropertyIterator of the arguments.
*
* @return an iteration of the arguments
*/
public PropertyIterator iterator() {
return getArguments().iterator();
}
/**
* Create a string representation of the arguments.
*
* @return the string representation of the arguments
*/
public String toString() {
StringBuffer str = new StringBuffer();
PropertyIterator iter = getArguments().iterator();
while (iter.hasNext()) {
[[#variablee05ece0]] arg = ( [[#variablee05ece0]]) iter.next().getObjectValue();
final String metaData = arg.getMetaData();
str.append(arg.getName());
if (metaData == null) {
str.append("="); //$NON-NLS$ //$NON-NLS-1$
}
else {
str.append(metaData);
}
str.append(arg.getValue());
if (iter.hasNext()) {
str.append("&"); //$NON-NLS$ //$NON-NLS-1$
}
}
return str.toString();
}
/**
* Remove the specified argument from the list.
*
* @param row
* the index of the argument to remove
*/
public void removeArgument(int row) {
if (row < getArguments().size()) {
getArguments().remove(row);
}
}
/**
* Remove the specified argument from the list.
*
* @param arg
* the argument to remove
*/
public void removeArgument( [[#variablee05ece0]] arg) {
PropertyIterator iter = getArguments().iterator();
while (iter.hasNext()) {
[[#variablee05ece0]] item = ( [[#variablee05ece0]]) iter.next().getObjectValue();
if (arg.equals(item)) {
iter.remove();
}
}
}
/**
* Remove the argument with the specified name.
*
* @param argName
* the name of the argument to remove
*/
public void removeArgument(String argName) {
PropertyIterator iter = getArguments().iterator();
while (iter.hasNext()) {
[[#variablee05ece0]] arg = ( [[#variablee05ece0]]) iter.next().getObjectValue();
if (arg.getName().equals(argName)) {
iter.remove();
}
}
}
/**
* Remove all arguments from the list.
*/
public void removeAllArguments() {
getArguments().clear();
}
/**
* Add a new empty argument to the list. The new argument will have the
* empty string as its name and value, and null metadata.
*/
public void addEmptyArgument() {
addArgument(new [[#variablee05ece0]]( [[#variablee05ec80]], "", null));
}
/**
* Get the number of arguments in the list.
*
* @return the number of arguments
*/
public int getArgumentCount() {
return getArguments().size();
}
/**
* Get a single argument.
*
* @param row
* the index of the argument to return.
* @return the argument at the specified index, or null if no argument
* exists at that index.
*/
public [[#variablee05ece0]] getArgument(int row) {
[[#variablee05ece0]] argument = null;
if (row < getArguments().size()) {
argument = ( [[#variablee05ece0]]) getArguments().get(row).getObjectValue();
}
return argument;
}
|