|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.osgi.framework.internal.core.Util
public class Util
This class contains utility functions.
| Constructor Summary | |
|---|---|
Util()
|
|
| Method Summary | |
|---|---|
static void |
dsort(java.lang.Object[] array,
int start,
int end)
Sorts the specified range in the array in descending order. |
static void |
qSortByString(java.lang.Object[] array,
int start,
int stop)
Sorts the array of objects by their string representation in ascending order. |
static void |
sort(java.lang.Object[] array,
int start,
int end)
Sorts the specified range in the array in ascending order. |
static void |
sortByString(java.lang.Object[] array)
Performs a quicksort of the given objects by their string representation in ascending order. |
static void |
swap(java.lang.Object[] array)
Reverse the elements in the array. |
static java.lang.String |
toString(java.lang.Object object,
int length)
Returns a string representation of the object in the given length. |
static java.lang.String |
toString(java.lang.Object object,
int length,
char pad,
boolean onLeft)
Returns a string representation of the object in the given length. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Util()
| Method Detail |
|---|
public static void sortByString(java.lang.Object[] array)
array - The array of objects to sort
public static void qSortByString(java.lang.Object[] array,
int start,
int stop)
This is a version of C.A.R Hoare's Quick Sort algorithm.
array - the array of objects to sortstart - the start index to begin sortingstop - the end index to stop sorting
java.lang.ArrayIndexOutOfBoundsException - when start < 0
or end >= array.length
public static void sort(java.lang.Object[] array,
int start,
int end)
array - the Object array to be sortedstart - the start index to sortend - the last + 1 index to sort
java.lang.ClassCastException - when an element in the array does not
implement Comparable or elements cannot be compared to each other
java.lang.IllegalArgumentException - when start > end
java.lang.ArrayIndexOutOfBoundsException - when start < 0
or end > array.size()
public static void dsort(java.lang.Object[] array,
int start,
int end)
array - the Object array to be sortedstart - the start index to sortend - the last + 1 index to sort
java.lang.ClassCastException - when an element in the array does not
implement Comparable or elements cannot be compared to each other
java.lang.IllegalArgumentException - when start > end
java.lang.ArrayIndexOutOfBoundsException - when start < 0
or end > array.size()public static void swap(java.lang.Object[] array)
array - the Object array to be reversed
public static java.lang.String toString(java.lang.Object object,
int length)
object - the object to convertlength - the length the output string
public static java.lang.String toString(java.lang.Object object,
int length,
char pad,
boolean onLeft)
object - the object to convertlength - the length the output stringpad - the pad characteronLeft - if true pad on the left, otherwise an the right
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||