# JDynArray (jremote API)

Read Time: 7 minute(s)

# Class JDynArray

All Implemented Interfaces:IByteObject


public class JDynArray
extends Object
implements IByteObject
1
2
3

The JDynArray is a jBASE type that implements a dynamic string array where attribute, value, and subvalue delimiters mark the array indices.

# Constructor Summary

Constructor and Description
JDynArray()
JDynArray(byte[] dynArray)
JDynArray(CharsetEncoder encoder, CharsetDecoder decoder, String strElement)
JDynArray(Charset cs, String strElement)
JDynArray(String strElement)
Construct a JDynArray from a String.

# Method Summary

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(ByteBuffer bArray, byte[] token, int startIndex, int endIndex)
protected static int count(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(String token, int attribute)
Return the number of tokens found in the supplied attribute.
int count(String token, int attribute, int value)
int count(String token, int attribute, int value, int subvalue)
protected static int dcount(ByteBuffer bArray, byte[] token, int startIndex, int endIndex)
protected static int dcount(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(Object other)
String get(int attribute)
String get(int attribute, int value)
String get(int attribute, int value, int subvalue)
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(ByteBuffer bArray, byte[] token, int nth, int startIndex, int endIndex)
static int index(ByteBuffer bArray, byte token, int nth, int startIndex, int endIndex)
void insert(String str, int attribute)
void insert(String str, int attribute, int value)
void insert(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(ByteBuffer bArray, byte token, int minIndex, int fromIndex)
protected boolean moveCursorToElement(byte token, int element)
void replace(String str, int attribute)
void replace(String str, int attribute, int value)
void replace(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(ByteBuffer byteBuffer)
Internal use only - IByteBuffer provides access to internal storage for serialization
void setCharset(Charset charset)
void setCharsetDecoder(CharsetDecoder decoder)
void setCharsetEncoder(CharsetEncoder encoder)
protected void setEndIndex(int idx)
protected void setStartIndex(int idx)
String toString()
Create a String from a JDynArray.
  • Methods inherited from class java.lang.Object
    • clone, finalize, getClass, notify, notifyAll, wait, wait, wait

# Constructor Detail

# JDynArray

public JDynArray()
1

# JDynArray

public JDynArray(byte[] dynArray)
1

# JDynArray

public JDynArray(String strElement)
1

Construct a JDynArray from a String. This is equivalent to JDynArray.replace("Your String", 1) Parameters:strElement -

# JDynArray

public JDynArray(Charset cs,
                 String strElement)
1
2

# JDynArray

public JDynArray(CharsetEncoder encoder,
                 CharsetDecoder decoder,
                 String strElement)
1
2
3

# Method Detail

# setCharset

public void setCharset(Charset charset)
1

# setCharsetEncoder

public void setCharsetEncoder(CharsetEncoder encoder)
1

# setCharsetDecoder

public void setCharsetDecoder(CharsetDecoder decoder)
1

# getStartIndex

protected int getStartIndex()
1

# getEndIndex

protected int getEndIndex()
1

# setStartIndex

protected void setStartIndex(int idx)
1

# setEndIndex

protected void setEndIndex(int idx)
1

# getBytes

public byte[] getBytes()
1

Description copied from interface: IByteObject

Return the bytes backing this IByteObject. Specified by:getBytes in interface IByteObject

# getByteBuffer

public ByteBuffer getByteBuffer()
                         throws IOException
1
2

Internal use only - IByteBuffer provide access to internal storage for serialization Specified by:getByteBuffer in interface IByteObject
Throws:IOException

# setByteBuffer

public void setByteBuffer(ByteBuffer byteBuffer)
                   throws IOException
1
2

Internal use only - IByteBuffer provides access to internal storage for serialization Specified by:setByteBuffer in interface IByteObject
Throws:IOException

# toString

public String toString()
1

Create a String from a JDynArray. Overrides:toString in class Object

# getNumberOfAttributes

public int getNumberOfAttributes()
1

# getNumberOfValues

public int getNumberOfValues(int attribute)
1

# getNumberOfSubValues

public int getNumberOfSubValues(int attribute,
                                int value)
1
2

# get

public String get(int attribute)
1

# get

public String get(int attribute,
                  int value)
1
2

# get

public String get(int attribute,
                  int value,
                  int subvalue)
1
2
3

# getBytes

protected byte[] getBytes(int attribute)
1

# getBytes

protected byte[] getBytes(int attribute,
                          int value)
1
2

# getBytes

protected byte[] getBytes(int attribute,
                          int value,
                          int subvalue)
1
2
3

# delete

public void delete(int attribute)
1

# delete

public void delete(int attribute,
                   int value)
1
2

# delete

public void delete(int attribute,
                   int value,
                   int subvalue)
1
2
3

# insert

public void insert(String str,
                   int attribute)
1
2

# insert

public void insert(String str,
                   int attribute,
                   int value)
1
2
3

# insert

public void insert(String str,
                   int attribute,
                   int value,
                   int subvalue)
1
2
3
4

# insertBytes

protected void insertBytes(byte[] b,
                           int attribute)
1
2

# insertBytes

protected void insertBytes(byte[] b,
                           int attribute,
                           int value)
1
2
3

# insertBytes

protected void insertBytes(byte[] b,
                           int attribute,
                           int value,
                           int subvalue)
1
2
3
4

# insertBytes

protected void insertBytes(byte[] newBytes)
1

# replace

public void replace(String str,
                    int attribute)
1
2

# replace

public void replace(String str,
                    int attribute,
                    int value)
1
2
3

# replace

public void replace(String str,
                    int attribute,
                    int value,
                    int subvalue)
1
2
3
4

# replaceBytes

protected void replaceBytes(byte[] b,
                            int attribute)
1
2

# replaceBytes

protected void replaceBytes(byte[] b,
                            int attribute,
                            int value)
1
2
3

# replaceBytes

protected void replaceBytes(byte[] b,
                            int attribute,
                            int value,
                            int subvalue)
1
2
3
4

# count

public int count(String token,
                 int attribute)
1
2

Return the number of tokens found in the supplied attribute.

# count

public int count(String token,
                 int attribute,
                 int value)
1
2
3

# count

public int count(String token,
                 int attribute,
                 int value,
                 int subvalue)
1
2
3
4

#

# count

protected int count(byte token,
                    int attribute)
1
2

# count

protected int count(byte token,
                    int attribute,
                    int value)
1
2
3

# count

protected int count(byte token,
                    int attribute,
                    int value,
                    int subvalue)
1
2
3
4

# count

protected int count(byte[] token,
                    int attribute)
1
2

# count

protected int count(byte[] token,
                    int attribute,
                    int value)
1
2
3

# count

protected int count(byte[] token,
                    int attribute,
                    int value,
                    int subvalue)
1
2
3
4

# insertElement

protected void insertElement(byte token,
                             int newIndex)
1
2

# replaceElement

protected void replaceElement(byte token,
                              int newIndex)
1
2

# dups

protected static byte[] dups(int size,
                             byte token)
1
2

# resetCursor

protected void resetCursor()
1

# moveCursorToElement

protected boolean moveCursorToElement(byte token,
                                      int element)
1
2

# index

public static int index(ByteBuffer bArray,
                        byte token,
                        int nth,
                        int startIndex,
                        int endIndex)
1
2
3
4
5

# index

public static int index(ByteBuffer bArray,
                        byte[] token,
                        int nth,
                        int startIndex,
                        int endIndex)
1
2
3
4
5

# lastIndex

protected static int lastIndex(ByteBuffer bArray,
                               byte token,
                               int minIndex,
                               int fromIndex)
1
2
3
4

# count

protected static int count(ByteBuffer bArray,
                           byte token,
                           int startIndex,
                           int endIndex)
1
2
3
4

# count

protected static int count(ByteBuffer bArray,
                           byte[] token,
                           int startIndex,
                           int endIndex)
1
2
3
4

# dcount

protected static int dcount(ByteBuffer bArray,
                            byte token,
                            int startIndex,
                            int endIndex)
1
2
3
4

# dcount

protected static int dcount(ByteBuffer bArray,
                            byte[] token,
                            int startIndex,
                            int endIndex)
1
2
3
4

# equals

public boolean equals(Object other)
1

Overrides:equals in class Object

# hashCode

public int hashCode()
1

Overrides:hashCode in class Object

Back to jRemote API