Welcome to jBASE's new documentation site! Many answers to your questions can be found by searching the Knowledgebase or viewing the jBASE Documentation. We also have a Google Group for peer discussion about jBASE. If you are unable to find the information you are looking for, jBASE Support will be glad to assist in resolving your technical problems. Enjoy and please provide comments and feedback .

How can we help you?

JDynArray (jrclient API)

Class JDynArray

All Implemented Interfaces:

Externalizable, Serializable, Cloneable
public final class JDynArray
extends Object
implements Cloneable, Externalizable
Represents a jBASE dynamic array
See Also:
Serialized Form


Constructor Summary

Constructor
 Description
JDynArray()
Default constructor
JDynArray(JDynArray src)
Constructs a dynamic array from another dynamic array
JDynArray(String src)
Constructs a dynamic array from a string



Method Summary

Modifier and Type
Method
 and Description
void
assign(JDynArray src)
Assigns the value of a dynamic array to this dynamic array
void
assign(String src)
Assigns a string value to this dynamic array
char
charAt(int index)
Gets a character at a given position in the dynamic array
Object
clone()

int
count(char delim)
Counts the number of given characters in this dynamic array
int
count(String delim)
Counts the number of given delimiters in this dynamic array
int
dcount(char delim)
Counts the number of fields separated by the given character
int
dcount(String delim)
Counts the number of fields separated by the given delimiter
void
delete(int amc)
Deletes the specified attribute
void
delete(int amc, int vmc)
Deletes the specified attribute or value
void
delete(int amc, int vmc, int svmc)
Deletes the specified attribute, value or sub-value
String
extract(int amc)
Extracts the specified attribute as a string
String
extract(int amc, int vmc)
Extracts the specified attribute or value as a string
String
extract(int amc, int vmc, int svmc)
Extracts the specified attribute, value or sub-value as a string
JDynArray
extractDA(int amc)
Extracts the specified attribute as a dynamic array
JDynArray
extractDA(int amc, int vmc)
Extracts the specified attribute or value as a dynamic array
JDynArray
extractDA(int amc, int vmc, int svmc)
Extracts the specified attribute, value or sub-value as a dynamic array
String
field(char delim, int fieldNo)
Extracts the specified field separated by the given delimiter character
String
field(String delim, int fieldNo)
Extracts the specified field separated by the given delimiter string
String
getString()
Retrieves the content of the dynamic array as a string
void
insert(JDynArray data, int amc)
Inserts data from the given dynamic array into the specified attribute
void
insert(JDynArray data, int amc, int vmc)
Inserts data from the given dynamic array into the specified attribute or value
void
insert(JDynArray data, int amc, int vmc, int svmc)
Inserts data from the given dynamic array into the specified attribute, value or sub-value
void
insert(String data, int amc)
Inserts string data into the specified attribute
void
insert(String data, int amc, int vmc)
Inserts string data into the specified attribute or value
void
insert(String data, int amc, int vmc, int svmc)
Inserts string data into the specified attribute, value or sub-value
void
insertDA(JDynArray data, int amc)
Inserts data from the given dynamic array into the specified attribute.
void
insertDA(JDynArray data, int amc, int vmc)
Inserts data from the given dynamic array into the specified attribute or value.
void
insertDA(JDynArray data, int amc, int vmc, int svmc)
Inserts data from the given dynamic array into the specified attribute, value or sub-value.
int
length()
Returns the length, in characters, of a dynamic array
int
locate(String searchStr)
Searches for a string in all attributes of the dynamic array
int
locate(String searchStr, int amc, int vmc, String order)
Searches for a string in all sub-values within a given value of the dynamic array.
int
locate(String searchStr, int amc, int vmc, String order, int start)
Similar to locate(String, int, int, String), but allows for a start position
int
locate(String searchStr, int amc, String order)
Searches for a string in all values within a given attribute of the dynamic array.
int
locate(String searchStr, int amc, String order, int start)
Similar to locate(String, int, String), but allows for a start position
int
locate(String searchStr, String order)
Searches for a string in all attributes of the dynamic array, which is in a given sort order
int
locateIgnoreCase(String searchStr)
Similar to locate(String), but performs a case-insensitive comparison
int
locateIgnoreCase(String searchStr, int amc, int vmc, String order)
Similar to locate(String, int, int, String), but performs a case-insensitive comparison
int
locateIgnoreCase(String searchStr, int amc, int vmc, String order, int start)
Similar to locate(String, int, int, String, int), but performs a case-insensitive comparison
int
locateIgnoreCase(String searchStr, int amc, String order)
Similar to locate(String, int, String), but performs a case-insensitive comparison
int
locateIgnoreCase(String searchStr, int amc, String order, int start)
Similar to locate(String, int, String, int), but performs a case-insensitive comparison
int
locateIgnoreCase(String searchStr, String order)
Similar to locate(String, String), but performs a case-insensitive comparison
void
readExternal(ObjectInput in)

void
replace(JDynArray data, int amc)
Replaces the given attribute with the content of specified dynamic array
void
replace(JDynArray data, int amc, int vmc)
Replaces the given attribute or value with the content of specified dynamic array
void
replace(JDynArray data, int amc, int vmc, int svmc)
Replaces the given attribute, value or sub-value with the content of specified dynamic array
void
replace(String data, int amc)
Replaces the given attribute with specified string
void
replace(String data, int amc, int vmc)
Replaces the given attribute or value with specified string
void
replace(String data, int amc, int vmc, int svmc)
Replaces the given attribute, value or sub-value with specified string
void
replaceDA(JDynArray data, int amc)
Replaces the given attribute with the content of specified dynamic array Same as replace(JDynArray, amc)
void
replaceDA(JDynArray data, int amc, int vmc)
Replaces the given attribute or value with the content of specified dynamic array Same as replace(JDynArray, amc, vmc)
void
replaceDA(JDynArray data, int amc, int vmc, int svmc)
Replaces the given attribute, value or sub-value with the content of specified dynamic array.
void
setCharAt(int index, char newChar)
Sets a character at a given location in the dynamic array
String
toString()

void
writeExternal(ObjectOutput out)



Methods inherited from class java.lang.Object

equals, finalize, getClass, hashCode, notify, notifyAll, wait



Constructor Detail

JDynArray 

public JDynArray() 

throws JException  

Default constructor 

Throws: JException



JDynArray 

public JDynArray(String src)  
throws JException  
Constructs a dynamic array from a string   
Parameters: src - Source string  
Throws:JException


jDynArray 

public JDynArray(JDynnArray src) 

throws JException   

Constructs a dynamic array from another dynamic array

Parameters: src - Source dynamic array

Throws: JException   


            

Method Detail

assign

public void assign(JDynArray src)  
throws JException 
Assigns the value of a dynamic array to this dynamic array  
Parameters:  src - Source dynamic array
Throws JException 



ASSIGN  

public void assign(String src)  

throws JException 

Assigns a string value to this dynamic array

Parameters: src - Source string 

Throws: JException


 

COUNT 

public int count(char delim) 

throws JException

Counts the number of given characters in this dynamic array 
Parameters: delim - Delimiter char  
Returns: Delimiter count 
Throws: JException


COUNT 

public int count(String delim)   

throws JException   

Counts the number of given delimiters in this dynamic array 

Parameters: delim - Delimiter string   

Returns: Delimiter count 

Throws: JException



DCOUNT

public int dcount(char delim)           

throws JException  

Counts the number of fields separated by the given character 

Parameters: delim - Delimiter char

Returns: Field count

Throws: JException



DCOUNT

public int dcount(String delim)    

throws JException  

Counts the number of fields separated by the given delimiter 

Parameters: delim - Delimiter string 

Returns: Field count 

Throws: JException




DELETE 

public void delete(int amc, int vmc, int svmc)        

throws JException 

Parameters: 

    amc - Attribute

    vmc - Value. This parameter can be 0

    svmc - Sub-value. This parameter can be 0

Throws: JException

Deletes the specified attribute, value or sub-value



DELETE  

public void delete(int amc, int vmc) 

throwsJException 

Deletes the specified attribute or value    

Parameters: 
amc - Attribute   
vmc - Value This parameter can be 0 
Throws: JException



      DELETE 

public void delete(int amc) 

throws JException   

Deletes the specified attribute 

Parameters: 

    amc - Attribute 

Throws: JException



        EXTRACTDA 

public JDynArray extractDA(int amc, int vmc, int svmc)

throws JException 

Extracts the specified attribute, value or sub-value as a dynamic array

Parameters:

amc - Attribute

vmc - Value. This parameter can be 0

svmc - Sub-value. This parameter can be 0

Returns: jDynArray containing the data extracted

Throws: JException



EXTRACTDA 

public JDynArray extractDA(int amc, int vmc) 

throws JException 

Extracts the specified attribute or value as a dynamic array 

Parameters:         

amc - Attribute        

vmc - Value. This parameter can be 0 

Returns:  JDynArray containing the data extracted 

Throws: JException



      EXTRACTDA 

public JDynArray extractDA(int amc) 
throws JException  
Extracts the specified attribute as a dynamic array 
Parameters:   
    amc - Attribute  
Returns: JDynArray containing the data extracted 
Throws: JException


       extract

public String extract(int amc, int vmc, int svmc) 

throws JException 

Extracts the specified attribute, value or sub-value as a string 

Parameters:     

amc - Attribute   

vmc - Value. This parameter can be 0  

svmc - Sub-value. This parameter can be 0  

Returns: Extracted data 

Throws: JException



        extract

public String extract(int amc, int vmc) 

throws JException 

Extracts the specified attribute or value as a string  

Parameters:        

amc - Attribute    

vmc - Value. This parameter can be 0     

Returns: Extracted Data  

Throws: JException 



extract

public String extract(int amc) 

throws JException

Extracts the specified attribute as a string 
Parameters:  
amc - Attribute 
Retruns: Extracted data

Throws: JException 



Field

public String field(char delim, int fieldNo) 

throws JException

Extracts the specified field separated by the given delimiter character 
Parameters:  
    delim - Delimiter    
    fieldNo - Field number to extract Returns: Field value 
Throws: JException


FIELD

public String field(String delim, int fieldNo) 

throws JException

Extracts the specified field separated by the given delimiter string 
Parameters:        
delim - Delimiter    
fieldNo - Field number to extract
Returns: Field value  

Throws:  JException



INSERTDATA 

public void insertDA(JDynArray data, int amc, int vmc, int svmc) 
throws JException  
Inserts data from the given dynamic array into the specified attribute, value or sub-value. Same as insert(JDynArray, int, iint) 
Parameters: 
    data - Dynamic array to insert
    amc - Attribute. This parameter can be -1 to append data at the end of the dynamic array
    vmc - Value. This parameter can be 0 or -1 to insert at the end of the dynamic array 
    svmc - Sub-value. This parameter can be 0 or -1 to insert at the end of the dynamic array 
Throws: JException 
See Also:  insert(JDynArray, int, int, int)


INSERTDA

public void insertDA(JDynArray data,   int amc, int vmc)        

throws JException 

Inserts data from the given dynamic array into the specified attribute or value. Same as insert(JDynArray, int, int)

Parameters: 

data - Dynamic array to insert  

amc - Attribute. This parameter can be -1 to append data at the end of the dynamic array 

vmc - Value. This parameter can be 0 or -1 to insert at the end of the dynamic array 

Throws: JException

See Also:  insert(JDynArray, int, int)


insertDA

public void insertDA(JDynArray data,int amc)   

throws JException

Inserts data from the given dynamic array into the specified attribute. Same as insert(JDynArray, int)  
Parameters: 
data - Dynamic array to insert 
amc - Attribute. This parameter can be -1 to append data at the end of the dynamic array
Throws:  JException 
See Also:  insert(JDynArray, int)



INSERT

public void insert(JDynArray data,int amc, int vmc, int svmc)            

throws JException 

Inserts data from the given dynamic array into the specified attribute, value or sub-value 

Parameters:

data - Dynamic array to insert

amc - Attribute. This parameter can be -1 to append data at the end of the dynamic array

vmc - Value. This parameter can be 0 or -1 to insert at the end of the dynamic array

svmc - Sub-value. This parameter can be 0 or -1 to insert at the end of the dynamic array

Throws: JException



insert          

public void insert(JDynArray data, int amc, int vmc) 

throws JException

Inserts data from the given dynamic array into the specified attribute or value
Parameters:
data - Dynamic array to insert
amc - Attribute. This parameter can be -1 to append data at the end of the dynamic array
vmc - Value. This parameter can be 0 or -1 to insert at the end of the dynamic array 
Throws: JException  



INSERT 

public void insert(JDynArray data, int amc)             

throws JException

Inserts data from the given dynamic array into the specified attribute 
Parameters: 
data - Dynamic array to insert 
amc - Attribute. This parameter can be -1 to append data at the end of the dynamic array  
Throws: JException 



insert

public void insert(String data, int amc, int vmc, int svmc)     

throws JException

Inserts string data into the specified attribute, value or sub-value 
Parameters: 
data - String to insert
amc - Attribute. This parameter can be -1 to append data at the end of the dynamic array
vmc - Value. This parameter can be 0 or -1 to insert at the end of the dynamic array
svmc - Sub-value. This parameter can be 0 or -1 to insert at the end of the dynamic array 
Throws:  JException 



INSERT 

public void insert(String data, int amc, int vmc)          

throws JException

Inserts string data into the specified attribute or value 
Parameters: 
data - String to insert
amc - Attribute. This parameter can be -1 to append data at the end of the dynamic array
vmc - Value. This parameter can be 0 or -1 to insert at the end of the dynamic array
Throws: JException



INSERT 

public void insert(String data,  int amc)  

throws JException

Inserts string data into the specified attribute 
Parameters:
data - String to insert
amc - Attribute. This parameter can be -1 to append data at the end of the dynamic array 
Throws:  JException 



length

public int length()          

throws JException

Returns the length, in characters, of a dynamic array 

Returns: Length of the dynamic array

Throws:  JException 



replaceDA

public void replaceDA(JDynArray data, int amc, int vmc, int svmc)    

throws JException

Replaces the given attribute, value or sub-value with the content of specified dynamic array. 
Same as: replace(JDynArray, int, int, int).
Parameters:
data - Dynamic array used for replacement
amc - Attribute. This parameter can be -1 to append data at the end of the dynamic array
vmc - Value. This parameter can be 0 or -1 to append the data at the end of the dynamic array
svmc - Sub-value. This parameter can be 0 or -1 to append the data at the end of the dynamic array 
Throws: JException
See Also: replace(JDynArray, int, int, int)



replaceDA

public void replaceDA(JDynArray data, int amc, int vmc) 

throws JException

Replaces the given attribute or value with the content of specified dynamic array Same as replace(JDynArray, amc, vmc) 
Parameters: 
data - Dynamic array used for replacement
amc - Attribute. This parameter can be -1 to append data at the end of the dynamic array
vmc - Value. This parameter can be 0 or -1 to append the data at the end of the dynamic array 
Throws: JException 
See Also: replace(JDynArray, int, int)



replaceDA

public void replaceDA(JDynArray data, int amc) 

throws JException 

Replaces the given attribute with the content of specified dynamic array Same as replace(JDynArray, amc)

Parameters:

data - Dynamic array used for replacement

amc - Attribute. This parameter can be -1 to append data at the end of the dynamic array

Throws: JException 

See Also: replace(JDynArray, int)



replace

public void replace(JDynArray data, int amc, int vmc, int svmc) 

throws JException 

Replaces the given attribute, value or sub-value with the content of specified dynamic array

Parameters:

data - Dynamic array used for replacement

amc - Attribute. This parameter can be -1 to append data at the end of the dynamic array

vmc - Value. This parameter can be 0 or -1 to append the data at the end of the dynamic array

svmc - Sub-value. This parameter can be 0 or -1 to append the data at the end of the dynamic array

Throws: JException 



replace

public void replace(JDynArray data, int amc, int vmc)       

throws JException

Replaces the given attribute or value with the content of specified dynamic array

Parameters:

data - Dynamic array used for replacement

amc - Attribute. This parameter can be -1 to append data at the end of the dynamic array

vmc - Value. This parameter can be 0 or -1 to append the data at the end of the dynamic array

Throws: JException  



replace

public void replace(JDynArray data, int amc) 

throws JException

Replaces the given attribute with the content of specified dynamic array

Parameters:

data - Dynamic array used for replacement

amc - Attribute. This parameter can be -1 to append data at the end of the dynamic array 

Throws: JException 



replace

public void replace(String data, int amc, int vmc, int svmc) 

throws JException

Replaces the given attribute, value or sub-value with specified string

Parameters:

data - Replacement string

amc - Attribute. This parameter can be -1 to append data at the end of the dynamic array

vmc - Value. This parameter can be 0 or -1 to append the data at the end of the dynamic array

svmc - Sub-value. This parameter can be 0 or -1 to append the data at the end of the dynamic array 

Throws:  JException 



replace

public void replace(String data, int amc, int vmc) 

throws JException

Replaces the given attribute or value with specified string

Parameters:

data - Replacement string

amc - Attribute. This parameter can be -1 to append data at the end of the dynamic array

vmc - Value. This parameter can be 0 or -1 to append the data at the end of the dynamic array 

Throws:  JException 



replace

public void replace(String data, int amc)            

throws JException 

Replaces the given attribute with specified string

Parameters:

data - Replacement string

amc - Attribute. This parameter can be -1 to append data at the end of the dynamic array

Throws:  JException



getString

public String getString()                 

throws JException 

Retrieves the content of the dynamic array as a string 

Returns: Dynamic array content 

Throws: JException 



toString

public String toString()

Overides :  toString in class Object 



charAt

public char charAt(int index) 

throws JException

Gets a character at a given position in the dynamic array

Parameters:  index - Character index

Returns:  Character at the given position in the dynamic array

Throws: JException



setCharAt

public void setCharAt(int index, char newChar)              

throws JException 

Sets a character at a given location in the dynamic array 

Parameters: 

index - Position of the character

newChar - Character to set

Throws: JException  



locate

public int locate(String searchStr)          

throws JException

Searches for a string in all attributes of the dynamic array 
Parameters:   searchStr - String to look for  
Returns:  Positive index of matching attribute or -1 if string is not found. 
Throws: JException 



locate

public int locate(String searchStr, String order)           

throws JException 

Searches for a string in all attributes of the dynamic array, which is in a given sort order 

Parameters: 

searchStr - String to look for

order - Order of the array, interpreted as follows:

"AL"
ascending, left-justified
"AR"
ascending, right-justified
"AN"
ascending, numeric
"DL"
descending, left-justified
"DR"
descending, right-justified
"DN"
 descending, numeric
""
no order

Returns: Positive index of matching attribute or negative index of insertion point if a match is not found. If order is specified as a blank string, the function always returns -1 to indicate that the string was not found.

Throws: JException


locate

public int locate(String searchStr, int amc, String order)            

throws JException 

Searches for a string in all values within a given attribute of the dynamic array. The values are in the specified sort order. 

Parameters:

searchStr - String to look for

amc - Attribute number

order - Order of values, interpreted as follows: 

"AL"
ascending, left-justified
"AR"
ascending, right-justified
"AN"
ascending, numeric
"DL"
descending, left-justified
"DR"
descending, right-justified
"DN"
 descending, numeric
""
no order

Returns: Positive index of matching value or negative index of insertion point if a match is not found. If order is specified as a blank string, the function always returns -1 to indicate that the string was not found. 

Throws: JException




locate

public int locate(String searchStr,  int amc, int vmc, String order) 

throws JException 

Searches for a string in all sub-values within a given value of the dynamic array. The sub-values are in the specified sort order. 

Parameters:

searchStr - String to look for

amc - Attribute number

vmc - Value number

order - Order of values, interpreted as follows: 

"AL"
ascending, left-justified
"AR"
ascending, right-justified
"AN"
ascending, numeric
"DL"
descending, left-justified
"DR"
descending, right-justified
"DN"
 descending, numeric
""
no order

Returns:  Positive index of matching sub-value or negative index of insertion point if a match is not found. If order is specified as a blank string, the function always returns -1 to indicate that the string was not found. 

Throws: JException



locate

public int locate(String searchStr, int amc, String order, int start) 

throws JException

Similar to: locate(String, int, String), but allows for a start position

Parameters:  

start - Start position of the search

Throws: JException


locate

public int locate(String searchStr, int amc, int vmc, String order, int start)   

throws JException

Similar to: locate(String, int, int, String), but allows for a start position

Parameters:  start - Start position of the search

Throws: JException



locateIgnoreCase

public int locateIgnoreCase(String searchStr)        

throws JException

Similar to: locate(String), but performs a case-insensitive comparison 
Throws: JException


locateIgnoreCase

public int locateIgnoreCase(String searchStr, String order)  

throws JException

Similar to: locate(String, String), but performs a case-insensitive comparison 
Throws: JException


locateIgnoreCase

public int locateIgnoreCase(String searchStr, int amc, String order) 

throws JException

Similar to: locate(String, int, String), but performs a case-insensitive comparison
Throws: JException


locateIgnoreCase

public int locateIgnoreCase(String searchStr, int amc, int vmc, String order)  

throws JException

Similar to: locate(String, int, int, String), but performs a case-insensitive comparison
Throws: JException


locateIgnoreCase

public int locateIgnoreCase(String searchStr, int amc, String order, int start) 

throws JException

Similar to: locate(String, int, String, int), but performs a case-insensitive comparison
Throws: JException


locateIgnoreCase

public int locateIgnoreCase(String searchStr, int amc, int vmc, String order, int start) 

throws JException

Similar to: locate(String, int, int, String, int), but performs a case-insensitive comparison 
Throws: JException


clone

public Object clone()

 Overides: clone in class Object



readExternal

public void readExternal(ObjectInput in) 

throws IOException, ClassNotFoundException 

Specified by: readExternal in interface Externalizable  

Throws: IOException, ClassNotFoundException



writeExternal

public void writeExternal(ObjectOutput out)                    

throws IOException 

Specified by: writeExternal in interface Externalizable

Throws:  IOException



Was this article helpful?