HATS 7.5.1 Web API Reference

Publicly accessible methods not documented here are for IBM internal use only and may change in a future release of the product.

com.ibm.hats.common
Class GlobalVariable

java.lang.Object
  extended by com.ibm.hats.common.GlobalVariable
All Implemented Interfaces:
IGlobalVariable

public class GlobalVariable
extends Object
implements IGlobalVariable

A HATS Global Variable is an object which can be the target of SetAction, ExtractAction, etc... The default implementation is a list of strings. Many of the methods are pass-through to the backing java.util.List object


Field Summary
protected  List list
          The contents of this global variable
 
Fields inherited from interface com.ibm.hats.common.IGlobalVariable
COPYRIGHT, OPERATOR_CONCAT, OPERATOR_DIVIDE, OPERATOR_ERROR, OPERATOR_MINUS, OPERATOR_MODULUS, OPERATOR_MULTIPLY, OPERATOR_NOP, OPERATOR_PLUS
 
Constructor Summary
GlobalVariable(String name)
          Constructs a global variable with the specified name
GlobalVariable(String name, Object obj)
          Constructs a global variable with the specified name and initial value
GlobalVariable(String name, String[] strings)
          Constructs a global variable with the specified name and initial value
 
Method Summary
 void add(int i, Object obj)
          Inserts one element into this global variable at the specified position
 void add(int i, String[] strings)
          Inserts the given strings into this global variable at the specified position
 void add(Object obj)
          Appends the given element to the end of this global variable
 void add(String[] strings)
          Appends the given strings as elements to the end of this global variable
 IGlobalVariable calculate(int gvOperator, int myIndex, IGlobalVariable otherVariable, int otherIndex, int decimalRounding)
          Perform an operation on another global variable, and return the result.
 void clear()
          Removes all of the elements of this global variable
 boolean equals(Object obj)
          Compares the specified object with the list for equality
 Object get()
          Gets this entire global variable as an object.
 Object get(int i)
          Gets the element of this global variable at the specified position as an object.
 Collection getAll()
          Gets this entire global variable as a collection of objects.
 String getName()
          Returns this global variable's name
 String getString()
          Gets this global variable as a single string.
 String getString(int i)
          Gets one element of this global variable as a single string.
 String getString(String separator)
          Gets all elements of this global variable as a single string, using the provided separator string to separate the elements in the returned string.
 boolean isEmpty()
          Returns true if this global variable has no contents
 void set(IGlobalVariable gv)
          Copies the values of the specified global variable into this one
 void set(int i, Object obj)
          Replaces the element of this global variable at the specified position with the given element
 void set(int i, String[] strings)
          Replaces the elements of this global variable starting the specified position with the given strings
 void set(Object obj)
          Replaces this entire global variable with the given element
 void set(String[] strings)
          Replaces this entire global variable with the given strings as elements
 void setList(ArrayList arrayList)
          Replaces the elements of this global variable with the elements in the given list.
 void setName(String name)
          Sets this global variable's name
 int size()
          Returns the number of elements in this global variable
 String toString()
          Returns this global variable as a string, for debugging purposes
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

list

protected List list
The contents of this global variable

Constructor Detail

GlobalVariable

public GlobalVariable(String name)
Constructs a global variable with the specified name


GlobalVariable

public GlobalVariable(String name,
                      Object obj)
Constructs a global variable with the specified name and initial value


GlobalVariable

public GlobalVariable(String name,
                      String[] strings)
Constructs a global variable with the specified name and initial value

Method Detail

setName

public void setName(String name)
Sets this global variable's name

Specified by:
setName in interface IGlobalVariable

getName

public String getName()
Returns this global variable's name

Specified by:
getName in interface IGlobalVariable

add

public void add(String[] strings)
Description copied from interface: IGlobalVariable
Appends the given strings as elements to the end of this global variable

Specified by:
add in interface IGlobalVariable

add

public void add(int i,
                String[] strings)
         throws IndexOutOfBoundsException
Description copied from interface: IGlobalVariable
Inserts the given strings into this global variable at the specified position

Specified by:
add in interface IGlobalVariable
Throws:
IndexOutOfBoundsException

add

public void add(Object obj)
Description copied from interface: IGlobalVariable
Appends the given element to the end of this global variable

Specified by:
add in interface IGlobalVariable

add

public void add(int i,
                Object obj)
         throws IndexOutOfBoundsException
Description copied from interface: IGlobalVariable
Inserts one element into this global variable at the specified position

Specified by:
add in interface IGlobalVariable
Throws:
IndexOutOfBoundsException

set

public void set(IGlobalVariable gv)
Description copied from interface: IGlobalVariable
Copies the values of the specified global variable into this one

Specified by:
set in interface IGlobalVariable

set

public void set(String[] strings)
Description copied from interface: IGlobalVariable
Replaces this entire global variable with the given strings as elements

Specified by:
set in interface IGlobalVariable

set

public void set(Object obj)
Description copied from interface: IGlobalVariable
Replaces this entire global variable with the given element

Specified by:
set in interface IGlobalVariable

setList

public void setList(ArrayList arrayList)
Replaces the elements of this global variable with the elements in the given list.

Parameters:
arrayList - List of elements to put in global variable

set

public void set(int i,
                String[] strings)
         throws IndexOutOfBoundsException
Description copied from interface: IGlobalVariable
Replaces the elements of this global variable starting the specified position with the given strings

Specified by:
set in interface IGlobalVariable
Throws:
IndexOutOfBoundsException

set

public void set(int i,
                Object obj)
         throws IndexOutOfBoundsException
Description copied from interface: IGlobalVariable
Replaces the element of this global variable at the specified position with the given element

Specified by:
set in interface IGlobalVariable
Throws:
IndexOutOfBoundsException

clear

public void clear()
Description copied from interface: IGlobalVariable
Removes all of the elements of this global variable

Specified by:
clear in interface IGlobalVariable

equals

public boolean equals(Object obj)
Description copied from interface: IGlobalVariable
Compares the specified object with the list for equality

Specified by:
equals in interface IGlobalVariable
Overrides:
equals in class Object

isEmpty

public boolean isEmpty()
Description copied from interface: IGlobalVariable
Returns true if this global variable has no contents

Specified by:
isEmpty in interface IGlobalVariable

size

public int size()
Description copied from interface: IGlobalVariable
Returns the number of elements in this global variable

Specified by:
size in interface IGlobalVariable

getString

public String getString()
Description copied from interface: IGlobalVariable
Gets this global variable as a single string. This is a convenience method because strings are required for inserting into host screens. It is up to the implementation how to respond to this method; either just the first element, or some combination of all elements can be returned.

Specified by:
getString in interface IGlobalVariable

getString

public String getString(String separator)
Description copied from interface: IGlobalVariable
Gets all elements of this global variable as a single string, using the provided separator string to separate the elements in the returned string. No attempt is made to "escape" the separator if it appears within the global variable elements themselves.

Specified by:
getString in interface IGlobalVariable

getString

public String getString(int i)
                 throws IndexOutOfBoundsException
Description copied from interface: IGlobalVariable
Gets one element of this global variable as a single string. This is a convenience method because strings are required for inserting into host screens.

Specified by:
getString in interface IGlobalVariable
Throws:
IndexOutOfBoundsException

get

public Object get()
Description copied from interface: IGlobalVariable
Gets this entire global variable as an object. It is up to the implementation how to respond to this method; either just the first element, or some combination of all elements can be returned.

Specified by:
get in interface IGlobalVariable

get

public Object get(int i)
           throws IndexOutOfBoundsException
Description copied from interface: IGlobalVariable
Gets the element of this global variable at the specified position as an object.

Specified by:
get in interface IGlobalVariable
Throws:
IndexOutOfBoundsException

getAll

public Collection getAll()
Description copied from interface: IGlobalVariable
Gets this entire global variable as a collection of objects. The return type must be one of the Java Collection types. It is up to the implementation how to respond to this method, the standard indexed global variable returns its list.

Specified by:
getAll in interface IGlobalVariable

calculate

public IGlobalVariable calculate(int gvOperator,
                                 int myIndex,
                                 IGlobalVariable otherVariable,
                                 int otherIndex,
                                 int decimalRounding)
                          throws NumberFormatException,
                                 IllegalArgumentException
Perform an operation on another global variable, and return the result.

Specified by:
calculate in interface IGlobalVariable
Parameters:
gvOperator - Global variable operation to perform.
myIndex - Index of value in this global variable to use.
otherVariable - Global variable to perform operation upon.
otherIndex - Index of value in gv2 to use.
decimalRounding - Number of decimal places to display, or -1 for no rounding.
Returns:
resulting global variable
Throws:
NumberFormatException
IllegalArgumentException

toString

public String toString()
Returns this global variable as a string, for debugging purposes

Overrides:
toString in class Object

HATS 7.5.1 (201005110649)