Weitere aktuelle Java-Titel finden Sie bei dpunkt.
 Inhaltsverzeichnis   Vorhergehendes Paket   Seite Zurück   Seite Vor   Nächstes Paket   Paketübersicht   Index

Klasse java.lang.reflect.Array1.1

java.lang.Object
   |
   +--java.lang.reflect.Array

Deklaration

public final class Array
extends java.lang.Object

Beschreibung

Die Klasse Array bietet die Möglichkeit, Arrays zu erzeugen und Elemente zuzuweisen oder abzurufen.


 
Methoden
public static native Objectget(Object array, int index)
public static native booleangetBoolean(Object array, int index)
public static native bytegetByte(Object array, int index)
public static native chargetChar(Object array, int index)
public static native doublegetDouble(Object array, int index)
public static native floatgetFloat(Object array, int index)
public static native intgetInt(Object array, int index)
public static native intgetLength(Object array)
public static native longgetLong(Object array, int index)
public static native shortgetShort(Object array, int index)
public static ObjectnewInstance(Class componentType, int length)
public static ObjectnewInstance(Class componentType, int[] dimensions)
public static native voidset(Object array, int index, Object value)
public static native voidsetBoolean(Object array, int index, boolean z)
public static native voidsetByte(Object array, int index, byte b)
public static native voidsetChar(Object array, int index, char c)
public static native voidsetDouble(Object array, int index, double d)
public static native voidsetFloat(Object array, int index, float f)
public static native voidsetInt(Object array, int index, int i)
public static native voidsetLong(Object array, int index, long l)
public static native voidsetShort(Object array, int index, short s)


 

Methoden im Detail

public static native Object get(Object array, int index)
Liefert das Element an der Position index aus dem Array array. Falls der Elementtyp von array ein einfacher Datentyp ist, wird ein entsprechendes Wrapper-Objekt zurückgegeben.
Exception: IllegalArgumentException
Exception: ArrayIndexOutOfBoundsException
Exception: NullPointerException
public static native boolean getBoolean(Object array, int index)
Liefert den Wert des Elements an der Position index aus array als boolean.
Exception: IllegalArgumentException
Exception: ArrayIndexOutOfBoundsException
Exception: NullPointerException
public static native byte getByte(Object array, int index)
Liefert den Wert des Elements an der Position index aus array als byte.
Exception: IllegalArgumentException
Exception: ArrayIndexOutOfBoundsException
Exception: NullPointerException
public static native char getChar(Object array, int index)
Liefert den Wert des Elements an der Position index aus array als char.
Exception: IllegalArgumentException
Exception: ArrayIndexOutOfBoundsException
Exception: NullPointerException
public static native double getDouble(Object array, int index)
Liefert den Wert des Elements an der Position index aus array als double.
Exception: IllegalArgumentException
Exception: ArrayIndexOutOfBoundsException
Exception: NullPointerException
public static native float getFloat(Object array, int index)
Liefert den Wert des Elements an der Position index aus array als float.
Exception: IllegalArgumentException
Exception: ArrayIndexOutOfBoundsException
Exception: NullPointerException
public static native int getInt(Object array, int index)
Liefert den Wert des Elements an der Position index aus array als int.
Exception: IllegalArgumentException
Exception: ArrayIndexOutOfBoundsException
Exception: NullPointerException
public static native int getLength(Object array)
Liefert die Länge von array zurück.
Exception: IllegalArgumentException
public static native long getLong(Object array, int index)
Liefert den Wert des Elements an der Position index aus array als long.
Exception: IllegalArgumentException
Exception: ArrayIndexOutOfBoundsException
Exception: NullPointerException
public static native short getShort(Object array, int index)
Liefert den Wert des Elements an der Position index aus array als short.
Exception: IllegalArgumentException
Exception: ArrayIndexOutOfBoundsException
Exception: NullPointerException
public static Object newInstance(Class componentType, int length)
Erzeugt ein neues Array mit der Länge length und dem Elementtyp componentType. Das Class-Objekt für componentType kann mit der Methode getClass(), die alle Objekte besitzen, ermittelt werden. Für einfache Datentypen muss das Datenelement TYPE der entsprechenden Wrapper-Klasse angegeben werden.
Exception: NegativeArraySizeException
Exception: NullPointerException
public static Object newInstance(Class componentType, int[] dimensions)
Erzeugt ein neues geschachteles Array mit den in dimensions enthaltenen Dimensionen und dem Elementtyp componentType. Dieses Class-Objekt kann mit der Methode getClass(), die alle Objekte besitzen, ermittelt werden. Für einfache Datentypen muss das Datenelement TYPE der entsprechenden Wrapper-Klasse angegeben werden.
Exception: IllegalArgumentException
Exception: NegativeArraySizeException
Exception: NullPointerException
public static native void set(Object array, int index, Object value)
Setzt den Wert des Elements von array an der Position index auf value.
Exception: IllegalArgumentException
Exception: ArrayIndexOutOfBoundsException
Exception: NullPointerException
public static native void setBoolean(Object array, int index, boolean z)
Setzt den Wert des Elements von array an der Position index auf z.
Exception: IllegalArgumentException
Exception: ArrayIndexOutOfBoundsException
Exception: NullPointerException
public static native void setByte(Object array, int index, byte b)
Setzt den Wert des Elements von array an der Position index auf b.
Exception: IllegalArgumentException
Exception: ArrayIndexOutOfBoundsException
public static native void setChar(Object array, int index, char c)
Setzt den Wert des Elements von array an der Position index auf c.
Exception: IllegalArgumentException
Exception: ArrayIndexOutOfBoundsException
Exception: NullPointerException
public static native void setDouble(Object array, int index, double d)
Setzt den Wert des Elements von array an der Position index auf d.
Exception: IllegalArgumentException
Exception: ArrayIndexOutOfBoundsException
Exception: NullPointerException
public static native void setFloat(Object array, int index, float f)
Setzt den Wert des Elements von array an der Position index auf f.
Exception: IllegalArgumentException
Exception: ArrayIndexOutOfBoundsException
Exception: NullPointerException
public static native void setInt(Object array, int index, int i)
Setzt den Wert des Elements von array an der Position index auf i.
Exception: IllegalArgumentException
Exception: ArrayIndexOutOfBoundsException
Exception: NullPointerException
public static native void setLong(Object array, int index, long l)
Setzt den Wert des Elements von array an der Position index auf l.
Exception: IllegalArgumentException
Exception: ArrayIndexOutOfBoundsException
Exception: NullPointerException
public static native void setShort(Object array, int index, short s)
Setzt den Wert des Elements von array an der Position index auf s.
Exception: IllegalArgumentException
Exception: ArrayIndexOutOfBoundsException
Exception: NullPointerException


 Inhaltsverzeichnis   Vorhergehendes Paket   Seite Zurück   Seite Vor   Nächstes Paket   Paketübersicht   Index

Copyright © 2002 dpunkt.Verlag, Heidelberg. Alle Rechte vorbehalten.