Java Doc for Array.java in  » 6.0-JDK-Modules » j2me » java » lang » reflect » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » java.lang.reflect 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.lang.reflect.Array

Array
final public class Array (Code)
The Array class provides static methods to dynamically create and access Java arrays.

Array permits widening conversions to occur during a get or set operation, but throws an IllegalArgumentException if a narrowing conversion would occur.
author:
   Nakul Saraiya





Method Summary
native public static  Objectget(Object array, int index)
     Returns the value of the indexed component in the specified array object.
native public static  booleangetBoolean(Object array, int index)
     Returns the value of the indexed component in the specified array object, as a boolean.
native public static  bytegetByte(Object array, int index)
     Returns the value of the indexed component in the specified array object, as a byte.
native public static  chargetChar(Object array, int index)
     Returns the value of the indexed component in the specified array object, as a char.
native public static  doublegetDouble(Object array, int index)
     Returns the value of the indexed component in the specified array object, as a double.
native public static  floatgetFloat(Object array, int index)
     Returns the value of the indexed component in the specified array object, as a float.
native public static  intgetInt(Object array, int index)
     Returns the value of the indexed component in the specified array object, as an int.
native public static  intgetLength(Object array)
     Returns the length of the specified array object, as an int.
native public static  longgetLong(Object array, int index)
     Returns the value of the indexed component in the specified array object, as a long.
native public static  shortgetShort(Object array, int index)
     Returns the value of the indexed component in the specified array object, as a short.
public static  ObjectnewInstance(Class componentType, int length)
     Creates a new array with the specified component type and length.
public static  ObjectnewInstance(Class componentType, int[] dimensions)
     Creates a new array with the specified component type and dimensions.
native public static  voidset(Object array, int index, Object value)
     Sets the value of the indexed component of the specified array object to the specified new value.
native public static  voidsetBoolean(Object array, int index, boolean z)
     Sets the value of the indexed component of the specified array object to the specified boolean value.
native public static  voidsetByte(Object array, int index, byte b)
     Sets the value of the indexed component of the specified array object to the specified byte value.
native public static  voidsetChar(Object array, int index, char c)
     Sets the value of the indexed component of the specified array object to the specified char value.
native public static  voidsetDouble(Object array, int index, double d)
     Sets the value of the indexed component of the specified array object to the specified double value.
native public static  voidsetFloat(Object array, int index, float f)
     Sets the value of the indexed component of the specified array object to the specified float value.
native public static  voidsetInt(Object array, int index, int i)
     Sets the value of the indexed component of the specified array object to the specified int value.
native public static  voidsetLong(Object array, int index, long l)
     Sets the value of the indexed component of the specified array object to the specified long value.
native public static  voidsetShort(Object array, int index, short s)
     Sets the value of the indexed component of the specified array object to the specified short value.



Method Detail
get
native public static Object get(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException(Code)
Returns the value of the indexed component in the specified array object. The value is automatically wrapped in an object if it has a primitive type.
Parameters:
  array - the array
Parameters:
  index - the index the (possibly wrapped) value of the indexed component inthe specified array
exception:
  NullPointerException - If the specified object is null
exception:
  IllegalArgumentException - If the specified object is notan array
exception:
  ArrayIndexOutOfBoundsException - If the specified index argument is negative, or if it is greater than or equal to thelength of the specified array



getBoolean
native public static boolean getBoolean(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException(Code)
Returns the value of the indexed component in the specified array object, as a boolean.
Parameters:
  array - the array
Parameters:
  index - the index the value of the indexed component in the specified array
exception:
  NullPointerException - If the specified object is null
exception:
  IllegalArgumentException - If the specified object is notan array, or if the indexed element cannot be converted to thereturn type by an identity or widening conversion
exception:
  ArrayIndexOutOfBoundsException - If the specified index argument is negative, or if it is greater than or equal to thelength of the specified array
See Also:   Array.get



getByte
native public static byte getByte(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException(Code)
Returns the value of the indexed component in the specified array object, as a byte.
Parameters:
  array - the array
Parameters:
  index - the index the value of the indexed component in the specified array
exception:
  NullPointerException - If the specified object is null
exception:
  IllegalArgumentException - If the specified object is notan array, or if the indexed element cannot be converted to thereturn type by an identity or widening conversion
exception:
  ArrayIndexOutOfBoundsException - If the specified index argument is negative, or if it is greater than or equal to thelength of the specified array
See Also:   Array.get



getChar
native public static char getChar(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException(Code)
Returns the value of the indexed component in the specified array object, as a char.
Parameters:
  array - the array
Parameters:
  index - the index the value of the indexed component in the specified array
exception:
  NullPointerException - If the specified object is null
exception:
  IllegalArgumentException - If the specified object is notan array, or if the indexed element cannot be converted to thereturn type by an identity or widening conversion
exception:
  ArrayIndexOutOfBoundsException - If the specified index argument is negative, or if it is greater than or equal to thelength of the specified array
See Also:   Array.get



getDouble
native public static double getDouble(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException(Code)
Returns the value of the indexed component in the specified array object, as a double.
Parameters:
  array - the array
Parameters:
  index - the index the value of the indexed component in the specified array
exception:
  NullPointerException - If the specified object is null
exception:
  IllegalArgumentException - If the specified object is notan array, or if the indexed element cannot be converted to thereturn type by an identity or widening conversion
exception:
  ArrayIndexOutOfBoundsException - If the specified index argument is negative, or if it is greater than or equal to thelength of the specified array
See Also:   Array.get



getFloat
native public static float getFloat(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException(Code)
Returns the value of the indexed component in the specified array object, as a float.
Parameters:
  array - the array
Parameters:
  index - the index the value of the indexed component in the specified array
exception:
  NullPointerException - If the specified object is null
exception:
  IllegalArgumentException - If the specified object is notan array, or if the indexed element cannot be converted to thereturn type by an identity or widening conversion
exception:
  ArrayIndexOutOfBoundsException - If the specified index argument is negative, or if it is greater than or equal to thelength of the specified array
See Also:   Array.get



getInt
native public static int getInt(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException(Code)
Returns the value of the indexed component in the specified array object, as an int.
Parameters:
  array - the array
Parameters:
  index - the index the value of the indexed component in the specified array
exception:
  NullPointerException - If the specified object is null
exception:
  IllegalArgumentException - If the specified object is notan array, or if the indexed element cannot be converted to thereturn type by an identity or widening conversion
exception:
  ArrayIndexOutOfBoundsException - If the specified index argument is negative, or if it is greater than or equal to thelength of the specified array
See Also:   Array.get



getLength
native public static int getLength(Object array) throws IllegalArgumentException(Code)
Returns the length of the specified array object, as an int.
Parameters:
  array - the array the length of the array
exception:
  IllegalArgumentException - if the object argument is notan array



getLong
native public static long getLong(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException(Code)
Returns the value of the indexed component in the specified array object, as a long.
Parameters:
  array - the array
Parameters:
  index - the index the value of the indexed component in the specified array
exception:
  NullPointerException - If the specified object is null
exception:
  IllegalArgumentException - If the specified object is notan array, or if the indexed element cannot be converted to thereturn type by an identity or widening conversion
exception:
  ArrayIndexOutOfBoundsException - If the specified index argument is negative, or if it is greater than or equal to thelength of the specified array
See Also:   Array.get



getShort
native public static short getShort(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException(Code)
Returns the value of the indexed component in the specified array object, as a short.
Parameters:
  array - the array
Parameters:
  index - the index the value of the indexed component in the specified array
exception:
  NullPointerException - If the specified object is null
exception:
  IllegalArgumentException - If the specified object is notan array, or if the indexed element cannot be converted to thereturn type by an identity or widening conversion
exception:
  ArrayIndexOutOfBoundsException - If the specified index argument is negative, or if it is greater than or equal to thelength of the specified array
See Also:   Array.get



newInstance
public static Object newInstance(Class componentType, int length) throws NegativeArraySizeException(Code)
Creates a new array with the specified component type and length. Invoking this method is equivalent to creating an array as follows:
 int[] x = {length};
 Array.newInstance(componentType, x);
 

Parameters:
  componentType - the Class object representing thecomponent type of the new array
Parameters:
  length - the length of the new array the new array
exception:
  NullPointerException - if the specifiedcomponentType parameter is null
exception:
  IllegalArgumentException - if componentType is Void.TYPE
exception:
  NegativeArraySizeException - if the specified length is negative



newInstance
public static Object newInstance(Class componentType, int[] dimensions) throws IllegalArgumentException, NegativeArraySizeException(Code)
Creates a new array with the specified component type and dimensions. If componentType represents a non-array class or interface, the new array has dimensions.length dimensions and  componentType  as its component type. If componentType represents an array class, the number of dimensions of the new array is equal to the sum of dimensions.length and the number of dimensions of componentType. In this case, the component type of the new array is the component type of componentType.

The number of dimensions of the new array must not exceed the number of array dimensions supported by the implementation (typically 255).
Parameters:
  componentType - the Class object representing the componenttype of the new array
Parameters:
  dimensions - an array of int types representing the dimensions ofthe new array the new array
exception:
  NullPointerException - if the specified componentType argument is null
exception:
  IllegalArgumentException - if the specified dimensions argument is a zero-dimensional array, or if the number ofrequested dimensions exceeds the limit on the number of array dimensions supported by the implementation (typically 255), or if componentType is Void.TYPE.
exception:
  NegativeArraySizeException - if any of the components inthe specified dimensions argument is negative.




set
native public static void set(Object array, int index, Object value) throws IllegalArgumentException, ArrayIndexOutOfBoundsException(Code)
Sets the value of the indexed component of the specified array object to the specified new value. The new value is first automatically unwrapped if the array has a primitive component type.
Parameters:
  array - the array
Parameters:
  index - the index into the array
Parameters:
  value - the new value of the indexed component
exception:
  NullPointerException - If the specified object argumentis null, or if the array component type is primitive and the specifiedvalue is null
exception:
  IllegalArgumentException - If the specified object argumentis not an array, or if the array component type is primitive andthe specified value cannot be converted to the primitive type bya combination of unwrapping and identity or widening conversions
exception:
  ArrayIndexOutOfBoundsException - If the specified index argument is negative, or if it is greater than or equal tothe length of the specified array



setBoolean
native public static void setBoolean(Object array, int index, boolean z) throws IllegalArgumentException, ArrayIndexOutOfBoundsException(Code)
Sets the value of the indexed component of the specified array object to the specified boolean value.
Parameters:
  array - the array
Parameters:
  index - the index into the array
Parameters:
  z - the new value of the indexed component
exception:
  NullPointerException - If the specified object argumentis null
exception:
  IllegalArgumentException - If the specified object argumentis not an array, or if the the specified value cannot be convertedto the underlying array's component type by an identity or aprimitive widening widening conversion
exception:
  ArrayIndexOutOfBoundsException - If the specified index argument is negative, or if it is greater than or equal tothe length of the specified array
See Also:   Array.set



setByte
native public static void setByte(Object array, int index, byte b) throws IllegalArgumentException, ArrayIndexOutOfBoundsException(Code)
Sets the value of the indexed component of the specified array object to the specified byte value.
Parameters:
  array - the array
Parameters:
  index - the index into the array
Parameters:
  b - the new value of the indexed component
exception:
  NullPointerException - If the specified object argumentis null
exception:
  IllegalArgumentException - If the specified object argumentis not an array, or if the the specified value cannot be convertedto the underlying array's component type by an identity or aprimitive widening widening conversion
exception:
  ArrayIndexOutOfBoundsException - If the specified index argument is negative, or if it is greater than or equal tothe length of the specified array
See Also:   Array.set



setChar
native public static void setChar(Object array, int index, char c) throws IllegalArgumentException, ArrayIndexOutOfBoundsException(Code)
Sets the value of the indexed component of the specified array object to the specified char value.
Parameters:
  array - the array
Parameters:
  index - the index into the array
Parameters:
  c - the new value of the indexed component
exception:
  NullPointerException - If the specified object argumentis null
exception:
  IllegalArgumentException - If the specified object argumentis not an array, or if the the specified value cannot be convertedto the underlying array's component type by an identity or aprimitive widening widening conversion
exception:
  ArrayIndexOutOfBoundsException - If the specified index argument is negative, or if it is greater than or equal tothe length of the specified array
See Also:   Array.set



setDouble
native public static void setDouble(Object array, int index, double d) throws IllegalArgumentException, ArrayIndexOutOfBoundsException(Code)
Sets the value of the indexed component of the specified array object to the specified double value.
Parameters:
  array - the array
Parameters:
  index - the index into the array
Parameters:
  d - the new value of the indexed component
exception:
  NullPointerException - If the specified object argumentis null
exception:
  IllegalArgumentException - If the specified object argumentis not an array, or if the the specified value cannot be convertedto the underlying array's component type by an identity or aprimitive widening widening conversion
exception:
  ArrayIndexOutOfBoundsException - If the specified index argument is negative, or if it is greater than or equal tothe length of the specified array
See Also:   Array.set



setFloat
native public static void setFloat(Object array, int index, float f) throws IllegalArgumentException, ArrayIndexOutOfBoundsException(Code)
Sets the value of the indexed component of the specified array object to the specified float value.
Parameters:
  array - the array
Parameters:
  index - the index into the array
Parameters:
  f - the new value of the indexed component
exception:
  NullPointerException - If the specified object argumentis null
exception:
  IllegalArgumentException - If the specified object argumentis not an array, or if the the specified value cannot be convertedto the underlying array's component type by an identity or aprimitive widening widening conversion
exception:
  ArrayIndexOutOfBoundsException - If the specified index argument is negative, or if it is greater than or equal tothe length of the specified array
See Also:   Array.set



setInt
native public static void setInt(Object array, int index, int i) throws IllegalArgumentException, ArrayIndexOutOfBoundsException(Code)
Sets the value of the indexed component of the specified array object to the specified int value.
Parameters:
  array - the array
Parameters:
  index - the index into the array
Parameters:
  i - the new value of the indexed component
exception:
  NullPointerException - If the specified object argumentis null
exception:
  IllegalArgumentException - If the specified object argumentis not an array, or if the the specified value cannot be convertedto the underlying array's component type by an identity or aprimitive widening widening conversion
exception:
  ArrayIndexOutOfBoundsException - If the specified index argument is negative, or if it is greater than or equal tothe length of the specified array
See Also:   Array.set



setLong
native public static void setLong(Object array, int index, long l) throws IllegalArgumentException, ArrayIndexOutOfBoundsException(Code)
Sets the value of the indexed component of the specified array object to the specified long value.
Parameters:
  array - the array
Parameters:
  index - the index into the array
Parameters:
  l - the new value of the indexed component
exception:
  NullPointerException - If the specified object argumentis null
exception:
  IllegalArgumentException - If the specified object argumentis not an array, or if the the specified value cannot be convertedto the underlying array's component type by an identity or aprimitive widening widening conversion
exception:
  ArrayIndexOutOfBoundsException - If the specified index argument is negative, or if it is greater than or equal tothe length of the specified array
See Also:   Array.set



setShort
native public static void setShort(Object array, int index, short s) throws IllegalArgumentException, ArrayIndexOutOfBoundsException(Code)
Sets the value of the indexed component of the specified array object to the specified short value.
Parameters:
  array - the array
Parameters:
  index - the index into the array
Parameters:
  s - the new value of the indexed component
exception:
  NullPointerException - If the specified object argumentis null
exception:
  IllegalArgumentException - If the specified object argumentis not an array, or if the the specified value cannot be convertedto the underlying array's component type by an identity or aprimitive widening widening conversion
exception:
  ArrayIndexOutOfBoundsException - If the specified index argument is negative, or if it is greater than or equal tothe length of the specified array
See Also:   Array.set



Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.