com.ibm.redback.redbeans
Class RedField

java.lang.Object
  |
  +--com.ibm.redback.redbeans.RbString
        |
        +--com.ibm.redback.redbeans.RedField

public class RedField
extends RbString


Field Summary
static char AM
          Attribute mark character
static char RM
          Record mark character
static char SVM
          Subvalue mark character
static char TM
          Text mark character
static char[] TOKCHRS
          Char array of all system delimiter characters
static java.lang.String TOKLIST
          String of all system delimiter characters
static char VM
          Value mark character
 
Constructor Summary
RedField()
          Construct a new RedField with no characters.
RedField(java.lang.String sval)
          Construct a new RedField object, setting its initial value to that of the passed string.
 
Method Summary
 int count()
          Return the number of values separated by an Value Mark, in this instance of a RedField object.
 int count(int vm_c)
          Return the number of values separated by a subvalue mark at the position specified.
 void del(int vm_c)
          Delete a dynamic string element in the current RedField string at the position specified.
 void del(int vm_c, int svm_c)
          Delete a dynamic string element in the current RedField string at the position specified.
 int getLength()
          Return the number of characters in this instance of a RedField object.
 int getLength(int vm_c)
          Return the number of characters at the position specified.
 java.lang.String getValue()
           
 java.lang.String getValue(int vm_c)
          Extract a dynamic string element from the current RedField string at the position specified.
 java.lang.String getValue(int vm_c, int svm_c)
          Extract a dynamic string element from the current RedField string at the position specified.
protected  java.lang.String getValue(int am_c, int vm_c, int svm_c)
           
 char getVM()
          Gets the value for value mark character
 void ins(int vm_c, int svm_c, java.lang.String pval)
          Insert a string into the current RedField string at the position specified.
 void ins(int vm_c, java.lang.String pval)
          Insert a string into the current RedField string at the position specified.
 void replace(int vm_c, int svm_c, java.lang.String pval)
          Replace a dynamic string element in the current RedField string at the position specified.
 void replace(int vm_c, java.lang.String pval)
          Replace a dynamic string element in the current RedField string at the position specified.
 void setAM(char AM)
          assign new value for AM character
 void setStringValue(java.lang.String sval)
          Set the RedField value to that of the passed string.
 void setSVM(char SVM)
          assign new value for SVM character
 void setVM(char VM)
          assign new value for VM character
 
Methods inherited from class com.ibm.redback.redbeans.RbString
alpha, alpha, col1, col2, convert, convert, count, count, count, count, countStr, field, field, field, field, fold, fold, length, matches, matches, num, num, string, swap, swap, toString, trim, trim, trim, trim
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RM

public static char RM
Record mark character

AM

public static char AM
Attribute mark character

VM

public static char VM
Value mark character

SVM

public static char SVM
Subvalue mark character

TM

public static char TM
Text mark character

TOKCHRS

public static final char[] TOKCHRS
Char array of all system delimiter characters

TOKLIST

public static final java.lang.String TOKLIST
String of all system delimiter characters
Constructor Detail

RedField

public RedField()
Construct a new RedField with no characters.

RedField

public RedField(java.lang.String sval)
Construct a new RedField object, setting its initial value to that of the passed string.
Parameters:
sval - a String
Method Detail

setStringValue

public void setStringValue(java.lang.String sval)
Set the RedField value to that of the passed string.
Parameters:
sval - a stringValue

ins

public void ins(int vm_c,
                java.lang.String pval)
Insert a string into the current RedField string at the position specified.
Parameters:
vm_c - an int - Value position for insert. may be set to -1 to indicate 'insert at end', but only if am_c is > 0.
pval - a String - the string value that is to be inserted at the specified position.

setAM

public void setAM(char AM)
assign new value for AM character
Parameters:
AM - the character to use a value mark

setVM

public void setVM(char VM)
assign new value for VM character
Parameters:
VM - the character to use a value mark

getVM

public char getVM()
Gets the value for value mark character

setSVM

public void setSVM(char SVM)
assign new value for SVM character
Parameters:
SVM - the character to use a value mark

ins

public void ins(int vm_c,
                int svm_c,
                java.lang.String pval)
Insert a string into the current RedField string at the position specified.
Parameters:
vm_c - an int - Value position for insert. may be set to -1 to indicate 'insert at end', but only if am_c is > 0.
svm_c - an int - Subvalue position for insert. may be set to -1 to indicate 'insert at end', but only if am_c and vm_c values are > 0.
pval - a String - the string value that is to be inserted at the specified position.

replace

public void replace(int vm_c,
                    java.lang.String pval)
Replace a dynamic string element in the current RedField string at the position specified.
Parameters:
vm_c - an int - Value position for delete.
pval - a String - the string value that replaces the string at the specified position. If the position does not exist in the target string, this string is inserted.

replace

public void replace(int vm_c,
                    int svm_c,
                    java.lang.String pval)
Replace a dynamic string element in the current RedField string at the position specified.
Parameters:
vm_c - an int - Value position for replace
svm_c - a int - subvalue position for replace
pval - a String - the string value that replaces the string at the specified position. If the position does not exist in the target string, this string is inserted.

del

public void del(int vm_c)
Delete a dynamic string element in the current RedField string at the position specified.
Parameters:
vm_c - an int - Value position for delete

del

public void del(int vm_c,
                int svm_c)
Delete a dynamic string element in the current RedField string at the position specified.
Parameters:
vm_c - an int - Value position for delete.
svm_c - an int - Subvalue position for delete.

getValue

public java.lang.String getValue()

getValue

public java.lang.String getValue(int vm_c,
                                 int svm_c)
Extract a dynamic string element from the current RedField string at the position specified.
Parameters:
vm_c - an int - Value position for extract.
svm_c - an int - Subvalue position for extract.
Returns:
a String value.

getValue

protected java.lang.String getValue(int am_c,
                                    int vm_c,
                                    int svm_c)

getValue

public java.lang.String getValue(int vm_c)
Extract a dynamic string element from the current RedField string at the position specified.
Parameters:
vm_c - an int - Value position for extract.
Returns:
a String value.

count

public int count()
Return the number of values separated by an Value Mark, in this instance of a RedField object.
Returns:
an int that represents how many times values separated by a Value Mark were found.

count

public int count(int vm_c)
Return the number of values separated by a subvalue mark at the position specified.
Parameters:
vm_c - an int - value mark position for extract.
Returns:
an int that represents how many times values separated by subvalue mark were found.

getLength

public int getLength()
Return the number of characters in this instance of a RedField object.
Returns:
an int that represents the number of characters

getLength

public int getLength(int vm_c)
Return the number of characters at the position specified.
Parameters:
vm_c - an int - value mark position for extract.
Returns:
an int that represents the number of characters