public class JDynArray extends java.lang.Object implements IByteObject
The JDynArray is a jBASE type that implements a dynamic string array where attribute, value, and subvalue delimiters mark the array indices.
Constructor and Description |
---|
JDynArray() |
JDynArray(byte[] dynArray) |
JDynArray(java.nio.charset.CharsetEncoder encoder,
java.nio.charset.CharsetDecoder decoder,
java.lang.String strElement) |
JDynArray(java.nio.charset.Charset cs,
java.lang.String strElement) |
JDynArray(java.lang.String strElement)
Construct a JDynArray from a String.
|
Modifier and Type | Method and Description |
---|---|
protected int |
count(byte[] token,
int attribute) |
protected int |
count(byte[] token,
int attribute,
int value) |
protected int |
count(byte[] token,
int attribute,
int value,
int subvalue) |
protected static int |
count(java.nio.ByteBuffer bArray,
byte[] token,
int startIndex,
int endIndex) |
protected static int |
count(java.nio.ByteBuffer bArray,
byte token,
int startIndex,
int endIndex) |
protected int |
count(byte token,
int attribute) |
protected int |
count(byte token,
int attribute,
int value) |
protected int |
count(byte token,
int attribute,
int value,
int subvalue) |
int |
count(java.lang.String token,
int attribute)
Return the number of tokens found in the supplied attribute.
|
int |
count(java.lang.String token,
int attribute,
int value) |
int |
count(java.lang.String token,
int attribute,
int value,
int subvalue) |
protected static int |
dcount(java.nio.ByteBuffer bArray,
byte[] token,
int startIndex,
int endIndex) |
protected static int |
dcount(java.nio.ByteBuffer bArray,
byte token,
int startIndex,
int endIndex) |
void |
delete(int attribute) |
void |
delete(int attribute,
int value) |
void |
delete(int attribute,
int value,
int subvalue) |
protected static byte[] |
dups(int size,
byte token) |
boolean |
equals(java.lang.Object other) |
java.lang.String |
get(int attribute) |
java.lang.String |
get(int attribute,
int value) |
java.lang.String |
get(int attribute,
int value,
int subvalue) |
java.nio.ByteBuffer |
getByteBuffer()
Internal use only - IByteBuffer provide access to internal
storage for serialization
|
byte[] |
getBytes()
Return the bytes backing this IByteObject.
|
protected byte[] |
getBytes(int attribute) |
protected byte[] |
getBytes(int attribute,
int value) |
protected byte[] |
getBytes(int attribute,
int value,
int subvalue) |
protected int |
getEndIndex() |
int |
getNumberOfAttributes() |
int |
getNumberOfSubValues(int attribute,
int value) |
int |
getNumberOfValues(int attribute) |
protected int |
getStartIndex() |
int |
hashCode() |
static int |
index(java.nio.ByteBuffer bArray,
byte[] token,
int nth,
int startIndex,
int endIndex) |
static int |
index(java.nio.ByteBuffer bArray,
byte token,
int nth,
int startIndex,
int endIndex) |
void |
insert(java.lang.String str,
int attribute) |
void |
insert(java.lang.String str,
int attribute,
int value) |
void |
insert(java.lang.String str,
int attribute,
int value,
int subvalue) |
protected void |
insertBytes(byte[] newBytes) |
protected void |
insertBytes(byte[] b,
int attribute) |
protected void |
insertBytes(byte[] b,
int attribute,
int value) |
protected void |
insertBytes(byte[] b,
int attribute,
int value,
int subvalue) |
protected void |
insertElement(byte token,
int newIndex) |
protected static int |
lastIndex(java.nio.ByteBuffer bArray,
byte token,
int minIndex,
int fromIndex) |
void |
map_data_to_array()
moves dynamic arrays data to a TreeMap
|
void |
map_data_to_dynamic()
move TreeMap to a dynamic arrays data
|
void |
map_enable_mapping(boolean status)
Turn on and off array mapping
|
java.lang.Integer |
map_last_key(java.util.TreeMap<java.lang.Integer,java.lang.Object> map)
get the index of the last key in array, maps are indexed by a number that
represents its attribute number
|
protected boolean |
moveCursorToElement(byte token,
int element) |
void |
replace(java.lang.String str,
int attribute) |
void |
replace(java.lang.String str,
int attribute,
int value) |
void |
replace(java.lang.String str,
int attribute,
int value,
int subvalue) |
protected void |
replaceBytes(byte[] b,
int attribute) |
protected void |
replaceBytes(byte[] b,
int attribute,
int value) |
protected void |
replaceBytes(byte[] b,
int attribute,
int value,
int subvalue) |
protected void |
replaceElement(byte token,
int newIndex) |
protected void |
resetCursor() |
void |
setByteBuffer(java.nio.ByteBuffer byteBuffer)
Internal use only - IByteBuffer provides access to internal
storage for serialization
|
void |
setCharset(java.nio.charset.Charset charset) |
void |
setCharsetDecoder(java.nio.charset.CharsetDecoder decoder) |
void |
setCharsetEncoder(java.nio.charset.CharsetEncoder encoder) |
protected void |
setEndIndex(int idx) |
protected void |
setStartIndex(int idx) |
java.lang.String |
toString()
Create a String from a JDynArray.
|
public JDynArray()
public JDynArray(byte[] dynArray)
public JDynArray(java.lang.String strElement)
Construct a JDynArray from a String. This is equivalent to JDynArray.replace("Your String", 1)
strElement
- public JDynArray(java.nio.charset.Charset cs, java.lang.String strElement)
public JDynArray(java.nio.charset.CharsetEncoder encoder, java.nio.charset.CharsetDecoder decoder, java.lang.String strElement)
public void map_enable_mapping(boolean status)
Turn on and off array mapping
public void map_data_to_array()
moves dynamic arrays data to a TreeMap
public void map_data_to_dynamic()
move TreeMap to a dynamic arrays data
public java.lang.Integer map_last_key(java.util.TreeMap<java.lang.Integer,java.lang.Object> map)
get the index of the last key in array, maps are indexed by a number that represents its attribute number
public void setCharset(java.nio.charset.Charset charset)
public void setCharsetEncoder(java.nio.charset.CharsetEncoder encoder)
public void setCharsetDecoder(java.nio.charset.CharsetDecoder decoder)
protected int getStartIndex()
protected int getEndIndex()
protected void setStartIndex(int idx)
protected void setEndIndex(int idx)
public byte[] getBytes()
IByteObject
Return the bytes backing this IByteObject.
getBytes
in interface IByteObject
public java.nio.ByteBuffer getByteBuffer() throws java.io.IOException
getByteBuffer
in interface IByteObject
java.io.IOException
public void setByteBuffer(java.nio.ByteBuffer byteBuffer) throws java.io.IOException
setByteBuffer
in interface IByteObject
java.io.IOException
public java.lang.String toString()
Create a String from a JDynArray.
toString
in class java.lang.Object
public int getNumberOfAttributes()
public int getNumberOfValues(int attribute)
public int getNumberOfSubValues(int attribute, int value)
public java.lang.String get(int attribute)
public java.lang.String get(int attribute, int value)
public java.lang.String get(int attribute, int value, int subvalue)
protected byte[] getBytes(int attribute)
protected byte[] getBytes(int attribute, int value)
protected byte[] getBytes(int attribute, int value, int subvalue)
public void delete(int attribute)
public void delete(int attribute, int value)
public void delete(int attribute, int value, int subvalue)
public void insert(java.lang.String str, int attribute)
public void insert(java.lang.String str, int attribute, int value)
public void insert(java.lang.String str, int attribute, int value, int subvalue)
protected void insertBytes(byte[] b, int attribute)
protected void insertBytes(byte[] b, int attribute, int value)
protected void insertBytes(byte[] b, int attribute, int value, int subvalue)
protected void insertBytes(byte[] newBytes)
public void replace(java.lang.String str, int attribute)
public void replace(java.lang.String str, int attribute, int value)
public void replace(java.lang.String str, int attribute, int value, int subvalue)
protected void replaceBytes(byte[] b, int attribute)
protected void replaceBytes(byte[] b, int attribute, int value)
protected void replaceBytes(byte[] b, int attribute, int value, int subvalue)
public int count(java.lang.String token, int attribute)
public int count(java.lang.String token, int attribute, int value)
public int count(java.lang.String token, int attribute, int value, int subvalue)
protected int count(byte token, int attribute)
protected int count(byte token, int attribute, int value)
protected int count(byte token, int attribute, int value, int subvalue)
protected int count(byte[] token, int attribute)
protected int count(byte[] token, int attribute, int value)
protected int count(byte[] token, int attribute, int value, int subvalue)
protected void insertElement(byte token, int newIndex)
protected void replaceElement(byte token, int newIndex)
protected static byte[] dups(int size, byte token)
protected void resetCursor()
protected boolean moveCursorToElement(byte token, int element)
public static int index(java.nio.ByteBuffer bArray, byte token, int nth, int startIndex, int endIndex)
public static int index(java.nio.ByteBuffer bArray, byte[] token, int nth, int startIndex, int endIndex)
protected static int lastIndex(java.nio.ByteBuffer bArray, byte token, int minIndex, int fromIndex)
protected static int count(java.nio.ByteBuffer bArray, byte token, int startIndex, int endIndex)
protected static int count(java.nio.ByteBuffer bArray, byte[] token, int startIndex, int endIndex)
protected static int dcount(java.nio.ByteBuffer bArray, byte token, int startIndex, int endIndex)
protected static int dcount(java.nio.ByteBuffer bArray, byte[] token, int startIndex, int endIndex)
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object