|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object anon.util.Util
public final class Util
Field Summary | |
---|---|
static java.lang.String |
VERSION_FORMAT
Defines the format of version numbers in the AN.ON project. |
Constructor Summary | |
---|---|
private |
Util()
This class works without being initialised and is completely static. |
Method Summary | |
---|---|
static boolean |
arraysEqual(byte[] arrayOne,
byte[] arrayTwo)
Tests if two byte arrays are equal. |
static boolean |
arraysEqual(byte[] a_arrayA,
int a_Aoff,
byte[] a_arrayB,
int a_Boff,
int a_length)
Tests if a_length positions of two arrays are equal. |
static boolean |
arraysEqual(char[] arrayOne,
char[] arrayTwo)
Tests if two charactet arrays are equal. |
private static void |
bubbleSortStrings(java.util.Vector a_vector,
java.lang.String[] buffer,
int[] bufferIndices)
Uses the Bubble Sort method to sort a vector of objects by comparing the output of the toString() method. |
static long |
convertVersionStringToNumber(java.lang.String a_version)
Converts a version string of the form xx.xx.xxx to a number |
private static int |
divide(java.lang.String[] a_IDs,
java.lang.String[] a_values,
int a_left,
int a_right)
|
static java.lang.String |
getStackTrace(java.lang.Throwable a_t)
Gets the stack trace of a Throwable as String. |
static java.lang.String |
getStaticFieldValue(java.lang.Class a_class,
java.lang.String a_fieldName)
Uses the reflection API to get the value of a static field in the given class, if the field is present. |
private static boolean |
isUmlaut(char a_character,
java.lang.String[] a_transformedUmlauts,
int a_position)
Tests if a character is an umlaut and, if yes, writes the umlaut in an ASCII form to the array of transformed umlauts at the specified position. |
static java.lang.String |
normaliseString(java.lang.String a_string,
int a_normLength)
Normalises a String to the given length by filling it up with spaces, if it does not already have this length or is even longer. |
static float |
parseFloat(java.lang.String a_string)
Implementation of parseFloat not implemented in JDK 1.1.8 |
private static void |
quicksort(java.lang.String[] a_IDs,
java.lang.String[] a_values,
int a_left,
int a_right)
|
static java.lang.String |
replaceAll(java.lang.String a_source,
java.lang.String a_toReplace,
java.lang.String a_replaceWith)
Since JDK 1.1.8 does not provide String.replaceAll(), this is an equivalent method. |
static void |
sort(java.lang.String[] a_ids,
java.lang.String[] a_values)
|
static java.util.Vector |
sortStrings(java.util.Vector a_vector)
Sorts a Vector alphabetically using the toString() method of each object. |
private static void |
swap(java.lang.String[] a_IDs,
java.lang.String[] a_values,
int a,
int b)
|
static java.lang.Object[] |
toArray(java.lang.Object a_object)
Creates an Object array from a single Object. |
static java.util.Vector |
toVector(java.lang.Object a_object)
Creates a Vector from a single Object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String VERSION_FORMAT
Constructor Detail |
---|
private Util()
Method Detail |
---|
public static java.lang.String normaliseString(java.lang.String a_string, int a_normLength)
a_string
- a Stringa_normLength
- a length to normalise the String
public static java.lang.String getStackTrace(java.lang.Throwable a_t)
a_t
- a Throwable
public static boolean arraysEqual(byte[] arrayOne, byte[] arrayTwo)
arrayOne
- a byte arrayarrayTwo
- another byte array
public static boolean arraysEqual(char[] arrayOne, char[] arrayTwo)
arrayOne
- a charactet arrayarrayTwo
- another charactet array
public static final boolean arraysEqual(byte[] a_arrayA, int a_Aoff, byte[] a_arrayB, int a_Boff, int a_length)
a_arrayA
- byte[]a_Aoff
- inta_arrayB
- byte[]a_Boff
- inta_length
- int
public static java.util.Vector toVector(java.lang.Object a_object)
a_object
- an Object
public static java.lang.Object[] toArray(java.lang.Object a_object)
a_object
- an Object
private static void swap(java.lang.String[] a_IDs, java.lang.String[] a_values, int a, int b)
public static java.util.Vector sortStrings(java.util.Vector a_vector)
a_vector
- a Vector
public static float parseFloat(java.lang.String a_string) throws java.lang.NumberFormatException
a_string
- String
java.lang.NumberFormatException
public static void sort(java.lang.String[] a_ids, java.lang.String[] a_values)
private static int divide(java.lang.String[] a_IDs, java.lang.String[] a_values, int a_left, int a_right)
private static void quicksort(java.lang.String[] a_IDs, java.lang.String[] a_values, int a_left, int a_right)
private static void bubbleSortStrings(java.util.Vector a_vector, java.lang.String[] buffer, int[] bufferIndices)
a_vector
- a Vectorbuffer
- a bufferbufferIndices
- indices for the bufferprivate static boolean isUmlaut(char a_character, java.lang.String[] a_transformedUmlauts, int a_position)
a_character
- a character; must be lower case !a_transformedUmlauts
- an array of transformed umlautsa_position
- the position to write into the array of umlauts; if the character is not an umlaut,
'null' is written at this position, otherwise the character transformed into an ASCII form
public static long convertVersionStringToNumber(java.lang.String a_version) throws java.lang.NumberFormatException
a_version
- a version string of the form xx.xx.xxx
java.lang.NumberFormatException
- if the version has an illegal formatpublic static java.lang.String replaceAll(java.lang.String a_source, java.lang.String a_toReplace, java.lang.String a_replaceWith)
public static java.lang.String getStaticFieldValue(java.lang.Class a_class, java.lang.String a_fieldName)
a_class
- a Classa_fieldName
- the field to read the value from
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |