| » Referenzen / Klassen / Arrays | ||
|
Diese Klasse stellt eine Vielzahl statischer Methoden für die Manipulation von Arrays bereit. |
||
|
| » Hierarchie | ||
|
|
||
| » Implementierung | ||
public class Arrays
extends Object
|
||
|
||
|
||
|
| » Elemente | ||
|
In der folgenden Liste sind alle von uns bereits referenzierten Elemente der Klasse aufgeführt. |
||
|
||
|
||
|
||
|
||
| » Methoden / asList | ||
|
Die Methoden liefern eine Liste aller Elemente im Array. |
||
| » Prototyp | ||
public static List asList(Object[] array)
|
||
| » Parameter | ||
|
||
| » Rückgabe | ||
|
||
| » Ausnahmen & Fehler | ||
|
keine |
||
|
| » Methoden / binarySearch [1][2][3][4][5][6][7] | ||||
|
Die Methoden sucht nach einem Element in einem Array. Das Array muss unbedingt vorher sortiert werden, da der Algorithmus sonst falsche Ergebnisse liefern könnte. Wenn das Array mehrere Elemente mit dem selben Wert beinhaltet, so ist nicht vorgeschrieben, welches geliefert wird. |
||||
| » Prototyp | ||||
public static int binarySearch( byte[] array, byte key)
public static int binarySearch( char[] array, char key)
public static int binarySearch(double[] array,double key)
public static int binarySearch( float[] array, float key)
public static int binarySearch( int[] array, int key)
public static int binarySearch( long[] array, long key)
public static int binarySearch( short[] array, short key)
|
||||
| » Parameter | ||||
|
||||
| » Rückgabe | ||||
|
||||
| » Ausnahmen & Fehler | ||||
|
keine |
||||
|
| » Methoden / binarySearch [8][9] | ||||||
|
Die Methoden sucht nach einem Element in einem Array. Das Array muss unbedingt vorher sortiert werden, da der Algorithmus sonst falsche Ergebnisse liefern könnte. Wenn das Array mehrere Elemente mit dem selben Wert beinhaltet, so ist nicht vorgeschrieben, welches geliefert wird. Optional kann ein Objekt übergeben werden, welches das Verfahren zum Vergleich des gesuchten Elements mit den Elementen des Arrays bestimmt. |
||||||
| » Prototyp | ||||||
public static int binarySearch(Object[] array,Object key)
public static int binarySearch(Object[] array,Object key,
Comparator comparator)
|
||||||
| » Parameter | ||||||
|
||||||
| » Rückgabe | ||||||
|
||||||
| » Ausnahmen & Fehler | ||||||
|
keine |
||||||
|
| » Methoden / equals [1][2][3][4][5][6][7][8][9] | ||||
|
Die Methoden vergleicht zwei Arrays. Diese gelten als gleich, wenn beide die gleiche Anzahl von Elementen haben und die korrespondierenden Elemente beider Arrays ebenfalls identisch sind. |
||||
| » Prototyp | ||||
public static boolean equals(boolean[] first,boolean[] second)
public static boolean equals( byte[] first, byte[] second)
public static boolean equals( char[] first, char[] second)
public static boolean equals( double[] first, double[] second)
public static boolean equals( float[] first, float[] second)
public static boolean equals( int[] first, int[] second)
public static boolean equals( long[] first, long[] second)
public static boolean equals( Object[] first, Object[] second)
public static boolean equals( short[] first, short[] second)
|
||||
| » Parameter | ||||
|
||||
| » Rückgabe | ||||
|
||||
| » Ausnahmen & Fehler | ||||
|
keine |
||||
|
| » Methoden / fill (Teil 1) [1][2][3][4][5][6][7][8][9] | ||||
|
Die Methoden weist jedem Element eines Arrays den gleichen Wert zu. |
||||
| » Prototyp | ||||
public static void fill(boolean[] array,boolean value)
public static void fill( byte[] array, byte value)
public static void fill( char[] array, char value)
public static void fill( double[] array, double value)
public static void fill( float[] array, float value)
public static void fill( int[] array, int value)
public static void fill( long[] array, long value)
public static void fill( Object[] array, Object value)
public static void fill( short[] array, short value)
|
||||
| » Parameter | ||||
|
||||
| » Rückgabe | ||||
|
keine |
||||
| » Ausnahmen & Fehler | ||||
|
keine |
||||
|
| » Methoden / fill (Teil 2) [1][2][3][4][5][6][7][8][9] | ||||||||
|
Die Methoden weist jedem Element einer Arraysequenz den gleichen Wert zu. |
||||||||
| » Prototyp | ||||||||
public static void fill(
boolean[] array,int begin,int end,boolean value)
public static void fill(
byte[] array,int begin,int end, byte value)
public static void fill(
char[] array,int begin,int end, char value)
public static void fill(
double[] array,int begin,int end, double value)
public static void fill(
float[] array,int begin,int end, float value)
public static void fill(
int[] array,int begin,int end, int value)
public static void fill(
long[] array,int begin,int end, long value)
public static void fill(
Object[] array,int begin,int end, Object value)
public static void fill(
short[] array,int begin,int end, short value)
|
||||||||
| » Parameter | ||||||||
|
||||||||
| » Rückgabe | ||||||||
|
keine |
||||||||
| » Ausnahmen & Fehler | ||||||||
|
||||||||
|
| » Methoden / sort (Teil 1) [1][2][3][4][5][6][7][8][9] | ||
|
Die Methoden sortiert alle Elemente des Arrays. |
||
| » Prototyp | ||
public static void sort(boolean[] array)
public static void sort( byte[] array)
public static void sort( char[] array)
public static void sort( double[] array)
public static void sort( float[] array)
public static void sort( int[] array)
public static void sort( long[] array)
public static void sort( Object[] array)
public static void sort( short[] array)
|
||
| » Parameter | ||
|
||
| » Rückgabe | ||
|
keine |
||
| » Ausnahmen & Fehler | ||
|
keine |
||
|
| » Methoden / sort (Teil 2) [1][2][3][4][5][6][7][8][9] | ||||||
|
Die Methode sortiert eine Sequenz von Elementen eines Arrays. |
||||||
| » Prototyp | ||||||
public static void sort(boolean[] array,int begin,int end)
public static void sort( byte[] array,int begin,int end)
public static void sort( char[] array,int begin,int end)
public static void sort( double[] array,int begin,int end)
public static void sort( float[] array,int begin,int end)
public static void sort( int[] array,int begin,int end)
public static void sort( long[] array,int begin,int end)
public static void sort( Object[] array,int begin,int end)
public static void sort( short[] array,int begin,int end)
|
||||||
| » Parameter | ||||||
|
||||||
| » Rückgabe | ||||||
|
keine |
||||||
| » Ausnahmen & Fehler | ||||||
|
||||||
|
| » Methoden / sort (Teil 3) [1][2] | ||||||||
|
Die Methode sortiert eine Sequenz von Elementen eines Arrays oder das gesamte Array, wenn keine Sequenz angegeben wird. Dabei kann ein Objekt übergeben werden, welches einen spezifischen Sortieralgorithmus implementiert. |
||||||||
| » Prototyp | ||||||||
public static void sort(
Object[] array, Comparator comparator)
public static void sort(
Object[] array,int begin,int end,Comparator comparator)
|
||||||||
| » Parameter | ||||||||
|
||||||||
| » Rückgabe | ||||||||
|
keine |
||||||||
| » Ausnahmen & Fehler | ||||||||
|
||||||||
|