|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jutil.TArray
public final class TArray
This is the TArray utility code class.
| Constructor Summary | |
|---|---|
TArray()
Ensure that no one can create instances of this Class. |
|
| Method Summary | |
|---|---|
static byte[] |
concat(byte[] array0,
byte[] array1)
Appends the contents of array1 to the end of array0 |
static int[] |
concat(int[] array0,
int[] array1)
Appends the contents of array1 to the end of array0 |
static java.lang.Object[] |
concat(java.lang.Object[] array,
java.lang.Object obj)
Appends the Object obj to the end of array0 |
static java.lang.Object[] |
concat(java.lang.Object[] array0,
java.lang.Object[] array1)
Appends the contents of array1 to the end of array0 |
static boolean |
contains(byte[] array,
byte b)
Check to see if the byte[] array contains the byte b |
static boolean |
contains(int[] array,
int i)
Check to see if the array contains the int i |
static boolean |
contains(java.lang.Object[] array,
java.lang.Object obj)
|
static void |
dump(byte[] array,
java.io.OutputStream out)
Dump contents of array to OutputStream |
static void |
dump(java.lang.Object[] array,
java.io.OutputStream out)
Dump contents of array to OutputStream |
static void |
dumpCompare(byte[] array0,
byte[] array1,
java.io.OutputStream out)
Dump and compare the contents of array0 and aaray1 to OutputStream |
static boolean |
equals(byte[] array0,
byte[] array1)
Compares the contents of the byte arrays for equality, uses the == operator |
static byte[] |
extract(byte[] array0,
int size)
extract: extracts size bytes from array0 starting at index 0 usage: byte[] bytes = org.jutil.TByteArray.extract(array0, 10); |
static byte[] |
extract(byte[] array0,
int size,
int index)
extract: extracts size bytes from array0 starting at index usage: byte[] bytes = org.jutil.TByteArray.extract(array0, 10, 5); |
static void |
fill(byte[] array,
byte value)
fill: fill all array elements with value |
static int |
indexOf(byte[] array,
byte b)
Find the position of the byte in the array |
static int |
indexOf(int[] array,
int i)
Find the position of the int in the array |
static int |
indexOf(java.lang.Object[] array,
java.lang.Object obj)
Find the position of the obj in the array, uses the Object's equals() method |
static int |
intAt(byte[] array,
int index)
Read an int value from an array; usage: org.jutil.TByteArray.intAt(byte[] array, int index); |
static void |
setIntAt(byte[] array,
int i,
int index)
Write an int value from an array; usage: org.jutil.TByteArray.setIntAt(byte[] array, int i, int index); |
static java.lang.String |
toString(byte[] array0)
usage: String str = org.jutil.TByteArray.toString(array0); |
static java.lang.String |
toString(byte[] array0,
java.lang.String enc)
usage: String str = org.jutil.TByteArray.toString(array0, "iso-8859-1"); |
static java.lang.String |
toString(java.lang.Object[] array)
Concat an Object[] to a String dividing with the delim char ',', using the objects default .toString() method |
static java.lang.String |
toString(java.lang.Object[] array,
char delim)
Concat an Object[] to a String dividing with the delim char, using the objects default .toString() |
static byte[] |
valueOf(java.lang.String string)
usage: byte[] bytes = org.jutil.TByteArray.valueOf(string); |
static byte[] |
valueOf(java.lang.String string,
java.lang.String enc)
usage: byte[] bytes = org.jutil.TByteArray.valueOf(string, "iso-8859-1"); |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TArray()
| Method Detail |
|---|
public static final boolean contains(java.lang.Object[] array,
java.lang.Object obj)
public static final int indexOf(java.lang.Object[] array,
java.lang.Object obj)
Usage:
int pos = org.jutil.TArray.indexOf(array, obj);
array - Object[]obj - Object
int -1 indicate not found otherwise the position in the array
NullPointerException - if the array or the obj is null.
public static final java.lang.Object[] concat(java.lang.Object[] array,
java.lang.Object obj)
Usage:
org.jutil.TArray.concat(array0, obj);
array0 - Object[]obj - Object
Object[]
NullPointerException - if the array is null.
public static final java.lang.Object[] concat(java.lang.Object[] array0,
java.lang.Object[] array1)
Usage:
org.jutil.TArray.concat(array0, array1);
array0 - Object[]array1 - Object[]
Object[]
NullPointerException - if the array0 or array1 is null.
public static final void dump(java.lang.Object[] array,
java.io.OutputStream out)
throws java.io.IOException
Usage:
org.jutil.TArray.dump(array, System.out);
array - Object[]out - java.io.OutputStream
NullPointerException - if the array or out is null.
java.io.IOExceptionpublic static final java.lang.String toString(java.lang.Object[] array)
Usage:
String str = org.jutil.TArray.toString(array);
array - Object[]
String
NullPointerException - if the array is null.
public static final java.lang.String toString(java.lang.Object[] array,
char delim)
Usage:
String str = org.jutil.TArray.toString(array, ',');
array - Object[]delim - char
String
NullPointerException - if the array is null.
public static final byte[] concat(byte[] array0,
byte[] array1)
Usage:
org.jutil.TArray.concat(array0, array1);
array0 - byte[]array1 - byte[]
byte[]
NullPointerException - if the array0 or array1 is null.
public static final boolean contains(byte[] array,
byte b)
Usage:
boolean contains = org.jutil.TArray.contains(array, i);
array - byte[]b - byte
boolean
NullPointerException - if the array is null.
public static final int indexOf(byte[] array,
byte b)
Usage:
int pos = org.jutil.TArray.indexOf(array, b);
array - byte[]b - byte
int -1 indicate not found otherwise the position in the array
NullPointerException - if the array is null.
public static final void fill(byte[] array,
byte value)
Usage:
org.jutil.TArray.fill(byte[] array, byte value);
array - byte[]value - byte
NullPointerException - if the array is null.
public static final void dump(byte[] array,
java.io.OutputStream out)
throws java.io.IOException
Usage:
org.jutil.TArray.dump(array, System.err);
array - byte[]out - java.io.OutputStream
NullPointerException - if the array or out is null.
java.io.IOException
public static final void dumpCompare(byte[] array0,
byte[] array1,
java.io.OutputStream out)
throws java.io.IOException
Usage:
org.jutil.TArray.dumpCompare(array0, array1, System.out);
array0 - byte[]array1 - byte[]out - java.io.OutputStream
NullPointerException - if the array0, array1 or out is null.
java.io.IOException
public static final boolean equals(byte[] array0,
byte[] array1)
Usage:
org.jutil.TArray.equals(array0, array1);
array0 - byte[]array1 - byte[]
boolean
NullPointerException - if the array0 or array1 is null.
public static final java.lang.String toString(byte[] array0)
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public static final java.lang.String toString(byte[] array0,
java.lang.String enc)
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public static final byte[] valueOf(java.lang.String string)
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public static final byte[] valueOf(java.lang.String string,
java.lang.String enc)
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public static final byte[] extract(byte[] array0,
int size)
public static final byte[] extract(byte[] array0,
int size,
int index)
public static final int intAt(byte[] array,
int index)
public static final void setIntAt(byte[] array,
int i,
int index)
public static final int[] concat(int[] array0,
int[] array1)
Usage:
org.jutil.TArray.concat(array0, array1);
array0 - int[]array1 - int[]
int[]
NullPointerException - if the array0 or array1 is null.
public static final boolean contains(int[] array,
int i)
Usage:
boolean contains = org.jutil.TArray.contains(array, i);
array - int[]i - int
boolean
NullPointerException - if the array is null.
public static final int indexOf(int[] array,
int i)
Usage:
int pos = org.jutil.TArray.indexOf(array, b);
array - int[]u - int
int -1 indicate not found otherwise the position in the array
NullPointerException - if the array is null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||