com.wrq.vhi.sconfig
Class VhiMvl

java.lang.Object
  extended by com.wrq.vhi.sconfig.VhiMvl
All Implemented Interfaces:
java.io.Serializable

public final class VhiMvl
extends java.lang.Object
implements java.io.Serializable

Class for working with an individual model variable list.

See Also:
Serialized Form

Constructor Summary
VhiMvl(java.lang.String mvlName, java.util.ArrayList varNames, java.util.ArrayList varValues)
          Constructor
VhiMvl(VhiMvl o)
          Copy constructor
 
Method Summary
 void add(java.util.Map mvlEntry)
          Add an entry to this MVL.
 java.util.Map get(int index)
          Get a model variable list entry.
 java.lang.String getMVLName()
          Get the name of this MVL.
 java.util.List getVariableNames()
          Obtain a list of the variable names associated with this MVL.
 void remove(int index)
          Remove an entry from this MVL.
 boolean remove(java.util.Map mvlEntry)
          Remove an entry from this MVL.
 boolean set(int index, java.util.Map values)
          Update a model variable list entry.
 int size()
          Obtain the number of entries in this MVL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VhiMvl

public VhiMvl(java.lang.String mvlName,
              java.util.ArrayList varNames,
              java.util.ArrayList varValues)
Constructor

Parameters:
mvlName - Name of the model variable list.
varNames - List of variable names.
varValues - List of Lists of variable values.

VhiMvl

public VhiMvl(VhiMvl o)
Copy constructor

Parameters:
o - Reference to a VhiMvl object to be cloned.
Method Detail

getMVLName

public java.lang.String getMVLName()
Get the name of this MVL.

Returns:
Name of this model variable list

getVariableNames

public java.util.List getVariableNames()
Obtain a list of the variable names associated with this MVL.

Returns:
List of model variable names.

size

public int size()
Obtain the number of entries in this MVL.

Returns:
Number of entries in this model variable list.

get

public java.util.Map get(int index)
Get a model variable list entry.

Parameters:
index - Index of the variable entry of interest.
Returns:
Map for this MVL entry with model variables as the keys and variable values as the entries.
Throws:
java.lang.IllegalArgumentException - if the index value is out of range.

set

public boolean set(int index,
                   java.util.Map values)
Update a model variable list entry.

Parameters:
index - Index of the variable entry of interest.
values - Map of variable names and updated value(s).
Returns:
Flag indicating that modification was successful.
Throws:
java.lang.IllegalArgumentException - if the index value is out of range, or the values Map is not valid.

remove

public boolean remove(java.util.Map mvlEntry)
Remove an entry from this MVL.

Parameters:
mvlEntry - MVL entry to be removed. The entry must contain the same variable names/values as an existing entry in this MVL, in order for an entry to be removed. If there are duplicate entries in the MVL, only a single (first matching) entry will deleted for each call to this method.
Returns:
Flag indicating that the MVL entry was found and removed.

remove

public void remove(int index)
Remove an entry from this MVL.

Parameters:
index - Index of the entry to be removed.
Throws:
java.lang.IllegalArgumentException - if the index value is out of range.

add

public void add(java.util.Map mvlEntry)
Add an entry to this MVL.

Parameters:
mvlEntry - Entry to be added.
Throws:
java.lang.IllegalArgumentException - if mvlEntry does not contain data that is valid and consistent with this MVL.