public class VariableList
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.util.ArrayList |
mVariable
The list of elements in the label
|
Constructor and Description |
---|
VariableList()
Creates an instance of a variable.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all variables from list.
|
void |
dump()
Prints out all variables in the variable list.
|
boolean |
findAndSet(java.lang.String name,
java.lang.String value)
Finds an item in an array list and set its value.
|
boolean |
findAndSet(java.lang.String name,
java.lang.String value,
boolean resolve)
Finds an item in an array list and set its value.
|
boolean |
findAndSet(Variable variable)
Finds a variable in the variable list and set its value.
|
boolean |
findAndSet(VariableList list)
Finds eavery variable in a list and sets it in this list.
|
boolean |
getBooleanValue(java.lang.String name)
Finds an item in a variable list and returns its value as an boolean.
|
int |
getIntValue(java.lang.String name)
Finds an item in a variable list and returns its value as an integer.
|
java.lang.String |
getValue(java.lang.String name)
Finds a variable in the variable list and returns its value.
|
java.lang.String |
getValue(java.lang.String name,
boolean blank)
Finds a variable in the variable list and returns its value.
|
java.util.Iterator |
iterator()
Returns an Iterator for the variables in the list.
|
java.lang.String |
replaceVariable(java.lang.String buffer)
Searches the passed string for variables and replaces each
variable with its current value.
|
java.lang.String |
replaceVariable(java.lang.String buffer,
boolean plain)
Searches the passed string for variables and replaces each
variable with its current value.
|
public void clear()
public boolean findAndSet(Variable variable)
variable
- the name of the variable to set.true
if an variable was set or added;
false
if unable to add the variable.public boolean findAndSet(VariableList list)
list
- the PPIVariableList of variables to add.true
if an variable was set or added;
false
if unable to add the variable.public boolean findAndSet(java.lang.String name, java.lang.String value)
name
- the name of the variable to set.value
- the value to set for the variable.true
if an variable was set or added;
false
if unable to add the variable.public boolean findAndSet(java.lang.String name, java.lang.String value, boolean resolve)
name
- the name of the variable to set.value
- the value to set for the variable.resolve
- a flag indicating whether to resolve variables in the
value.true
if an variable was set or added;
false
if unable to add the variable.public java.lang.String getValue(java.lang.String name)
name
- the name of the variable to set.null
if an variable does not exist;
the value assigned to the variable if it does.public java.lang.String getValue(java.lang.String name, boolean blank)
name
- the name of the variable to set.blank
- indicates whether to return a blank string if not
the variable is not found. If true
a
blank is returned.null
if a variable does not exist and
blank
is false
. Returns a blank string
if blank
is true;
the value assigned to the variable if it does.public int getIntValue(java.lang.String name)
name
- the name of the variable to set.public boolean getBooleanValue(java.lang.String name)
name
- the name of the variable to set.public java.lang.String replaceVariable(java.lang.String buffer)
buffer
- the string to search for variables.public java.lang.String replaceVariable(java.lang.String buffer, boolean plain)
buffer
- the string to search for variables.plain
- indicates whether the replaced value of a variable should be
enclosed in quotation marks. If true, the value will be unadorned.public java.util.Iterator iterator()
public void dump()
Copyright © 2008-2018 Regents University of California. All Rights Reserved.