com.rocketsoftware.mvapi.utility
Class MVDynArray

java.lang.Object
  extended by com.rocketsoftware.mvapi.utility.MVDynArray

public class MVDynArray
extends java.lang.Object

Models a Multivalued dynamic array.


Constructor Summary
MVDynArray()
           
MVDynArray(java.lang.String array)
           
 
Method Summary
 java.lang.String insert(int attrNum, int valNum, int subValNum, java.lang.String subValue)
          Inserts a sub value into a dynamic array.
 java.lang.String insert(int attrNum, int valNum, java.lang.String value)
          Inserts a value into a dynamic array.
 java.lang.String insert(int attrNum, java.lang.String attribute)
          Inserts an attribute into a dynamic array.
 int MVIndex(int start, char c)
          Returns an index into dynamic array after specified number of delimiters.
 java.lang.String replace(int attrNum, int valNum, int subValNum, java.lang.String subValue)
          Replaces a sub value in a dynamic array.
 java.lang.String replace(int attrNum, int valNum, java.lang.String value)
          Replaces a value in a dynamic array.
 java.lang.String replace(int attrNum, java.lang.String attribute)
          Replaces an attribute in a dynamic array.
 void setArray(java.lang.String array)
          Sets the dynamic array to the provided array string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MVDynArray

public MVDynArray(java.lang.String array)

MVDynArray

public MVDynArray()
Method Detail

setArray

public void setArray(java.lang.String array)
Sets the dynamic array to the provided array string.

Parameters:
array - A String with embedded MV system delimiters AM, VM, SVM representing a dynamic array.

insert

public java.lang.String insert(int attrNum,
                               int valNum,
                               int subValNum,
                               java.lang.String subValue)
Inserts a sub value into a dynamic array.

Parameters:
attrNum - 1-relative index of the attribute containing the value containing the subvalue to insert
valNum - 1-relative index of the value containg the subvalue to insert
subValNum - 1-relative index of the subvalue to insert
Returns:
dynamic array with the specified subvalue in the specified value in the specified attribute inserted.

insert

public java.lang.String insert(int attrNum,
                               int valNum,
                               java.lang.String value)
Inserts a value into a dynamic array.

Parameters:
attrNum - 1-relative index of the attribute containing the value containing the subvalue to insert
valNum - 1-relative index of the value containg the subvalue to insert
Returns:
dynamic array with the specified subvalue in the specified value in the specified attribute inserted.

insert

public java.lang.String insert(int attrNum,
                               java.lang.String attribute)
Inserts an attribute into a dynamic array.

Parameters:
attrNum - 1-relative index of the attribute containing the value containing the subvalue to insert
Returns:
dynamic array with the specified attribute in the specified value in the specified attribute inserted.

replace

public java.lang.String replace(int attrNum,
                                int valNum,
                                int subValNum,
                                java.lang.String subValue)
Replaces a sub value in a dynamic array.

Parameters:
attrNum - 1-relative index of the attribute containing the value containing the sub value to replace
valNum - 1-relative index of the value containing the subvalue to replace
subValNum - 1-relative index of the sub value to replace
Returns:
dynamic array with the specified sub value in the specified value in the specified attribute replaced.

replace

public java.lang.String replace(int attrNum,
                                int valNum,
                                java.lang.String value)
Replaces a value in a dynamic array.

Parameters:
attrNum - 1-relative index of the attribute containing the value containing the subvalue to replace
valNum - 1-relative index of the value containg the subvalue to replace
Returns:
dynamic array with the specified subvalue in the specified value in the specified attribute replaced.

replace

public java.lang.String replace(int attrNum,
                                java.lang.String attribute)
Replaces an attribute in a dynamic array.

Parameters:
attrNum - 1-relative index of the attribute containing the value containing the subvalue to replace
Returns:
dynamic array with the specified attribute in the specified value in the specified attribute replaced.

MVIndex

public int MVIndex(int start,
                   char c)
Returns an index into dynamic array after specified number of delimiters.

Parameters:
c - character
Returns:
position; negative position means it is a count of delimiters to append