javax.management.openmbean
Class ArrayType

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.management.openmbean.OpenType sample code for javax.management.openmbean.OpenType definition code for javax.management.openmbean.OpenType 
      extended by javax.management.openmbean.ArrayType
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable

public class ArrayType
extends OpenType sample code for javax.management.openmbean.OpenType definition code for javax.management.openmbean.OpenType
implements Serializable sample code for java.io.Serializable definition code for java.io.Serializable

The ArrayType class is the open type class whose instances describe all open data values which are n-dimensional arrays of open data values.

Since:
1.5
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.management.openmbean.OpenType sample code for javax.management.openmbean.OpenType definition code for javax.management.openmbean.OpenType
ALLOWED_CLASSNAMES sample code for javax.management.openmbean.OpenType.ALLOWED_CLASSNAMES definition code for javax.management.openmbean.OpenType.ALLOWED_CLASSNAMES
 
Constructor Summary
ArrayType sample code for javax.management.openmbean.ArrayType.ArrayType(int, javax.management.openmbean.OpenType) definition code for javax.management.openmbean.ArrayType.ArrayType(int, javax.management.openmbean.OpenType) (int dimension, OpenType sample code for javax.management.openmbean.OpenType definition code for javax.management.openmbean.OpenType  elementType)
          Constructs an ArrayType instance describing open data values which are arrays with dimension dimension of elements whose open type is elementType.
 
Method Summary
 boolean equals sample code for javax.management.openmbean.ArrayType.equals(java.lang.Object) definition code for javax.management.openmbean.ArrayType.equals(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  obj)
          Compares the specified obj parameter with this ArrayType instance for equality.
 int getDimension sample code for javax.management.openmbean.ArrayType.getDimension() definition code for javax.management.openmbean.ArrayType.getDimension() ()
          Returns the dimension of arrays described by this ArrayType instance.
 OpenType sample code for javax.management.openmbean.OpenType definition code for javax.management.openmbean.OpenType getElementOpenType sample code for javax.management.openmbean.ArrayType.getElementOpenType() definition code for javax.management.openmbean.ArrayType.getElementOpenType() ()
          Returns the open type of element values contained in the arrays described by this ArrayType instance.
 int hashCode sample code for javax.management.openmbean.ArrayType.hashCode() definition code for javax.management.openmbean.ArrayType.hashCode() ()
          Returns the hash code value for this ArrayType instance.
 boolean isValue sample code for javax.management.openmbean.ArrayType.isValue(java.lang.Object) definition code for javax.management.openmbean.ArrayType.isValue(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  obj)
          Tests whether obj is a value for this ArrayType instance.
 String sample code for java.lang.String definition code for java.lang.String toString sample code for javax.management.openmbean.ArrayType.toString() definition code for javax.management.openmbean.ArrayType.toString() ()
          Returns a string representation of this ArrayType instance.
 
Methods inherited from class javax.management.openmbean.OpenType sample code for javax.management.openmbean.OpenType definition code for javax.management.openmbean.OpenType
getClassName sample code for javax.management.openmbean.OpenType.getClassName() definition code for javax.management.openmbean.OpenType.getClassName() , getDescription sample code for javax.management.openmbean.OpenType.getDescription() definition code for javax.management.openmbean.OpenType.getDescription() , getTypeName sample code for javax.management.openmbean.OpenType.getTypeName() definition code for javax.management.openmbean.OpenType.getTypeName() , isArray sample code for javax.management.openmbean.OpenType.isArray() definition code for javax.management.openmbean.OpenType.isArray()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

ArrayType sample code for javax.management.openmbean.ArrayType(int, javax.management.openmbean.OpenType) definition code for javax.management.openmbean.ArrayType(int, javax.management.openmbean.OpenType)

public ArrayType(int dimension,
                 OpenType sample code for javax.management.openmbean.OpenType definition code for javax.management.openmbean.OpenType  elementType)
          throws OpenDataException sample code for javax.management.openmbean.OpenDataException definition code for javax.management.openmbean.OpenDataException 
Constructs an ArrayType instance describing open data values which are arrays with dimension dimension of elements whose open type is elementType.

When invoked on an ArrayType instance, the getClassName sample code for javax.management.openmbean.OpenType.getClassName() definition code for javax.management.openmbean.OpenType.getClassName() method returns the class name of the array instances it describes (following the rules defined by the getName sample code for java.lang.Class.getName() definition code for java.lang.Class.getName() method of java.lang.Class), not the class name of the array elements (which is returned by a call to getElementOpenType().getClassName()).

The internal field corresponding to the type name of this ArrayType instance is also set to the class name of the array instances it describes. In other words, the methods getClassName and getTypeName return the same string value. The internal field corresponding to the description of this ArrayType instance is set to a string value which follows the following template:
<dimension>-dimension array of <element_class_name>

As an example, the following piece of code:

 ArrayType t = new ArrayType(3, SimpleType.STRING);
 System.out.println("array class name       = "+ t.getClassName());
 System.out.println("element class name     = "+ t.getElementOpenType().getClassName());
 System.out.println("array type name        = "+ t.getTypeName());
 System.out.println("array type description = "+ t.getDescription());
 
would produce the following output:
 array class name       = [[[java.lang.String;
 element class name     = java.lang.String
 array type name        = [[[java.lang.String;
 array type description = 3-dimension array of java.lang.String
 

Parameters:
dimension - the dimension of arrays described by this ArrayType instance; must be greater than or equal to 1.
elementType - the open type of element values contained in the arrays described by this ArrayType instance; must be an instance of either SimpleType, CompositeType or TabularType.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if dimension is not a positive integer
OpenDataException sample code for javax.management.openmbean.OpenDataException definition code for javax.management.openmbean.OpenDataException - if elementType is an instance of ArrayType
Method Detail

getDimension sample code for javax.management.openmbean.ArrayType.getDimension() definition code for javax.management.openmbean.ArrayType.getDimension()

public int getDimension()
Returns the dimension of arrays described by this ArrayType instance.

Returns:
the dimension.

getElementOpenType sample code for javax.management.openmbean.ArrayType.getElementOpenType() definition code for javax.management.openmbean.ArrayType.getElementOpenType()

public OpenType sample code for javax.management.openmbean.OpenType definition code for javax.management.openmbean.OpenType  getElementOpenType()
Returns the open type of element values contained in the arrays described by this ArrayType instance.

Returns:
the element type.

isValue sample code for javax.management.openmbean.ArrayType.isValue(java.lang.Object) definition code for javax.management.openmbean.ArrayType.isValue(java.lang.Object)

public boolean isValue(Object sample code for java.lang.Object definition code for java.lang.Object  obj)
Tests whether obj is a value for this ArrayType instance.

This method returns true if and only if obj is not null, obj is an array and any one of the following is true:

Specified by:
isValue sample code for javax.management.openmbean.OpenType.isValue(java.lang.Object) definition code for javax.management.openmbean.OpenType.isValue(java.lang.Object) in class OpenType sample code for javax.management.openmbean.OpenType definition code for javax.management.openmbean.OpenType
Parameters:
obj - the object to be tested.
Returns:
true if obj is a value for this ArrayType instance.

equals sample code for javax.management.openmbean.ArrayType.equals(java.lang.Object) definition code for javax.management.openmbean.ArrayType.equals(java.lang.Object)

public boolean equals(Object sample code for java.lang.Object definition code for java.lang.Object  obj)
Compares the specified obj parameter with this ArrayType instance for equality.

Two ArrayType instances are equal if and only if they describes array instances which have the same dimension and elements' open type.

Specified by:
equals sample code for javax.management.openmbean.OpenType.equals(java.lang.Object) definition code for javax.management.openmbean.OpenType.equals(java.lang.Object) in class OpenType sample code for javax.management.openmbean.OpenType definition code for javax.management.openmbean.OpenType
Parameters:
obj - the object to be compared for equality with this ArrayType instance; if obj is null or is not an instance of the class ArrayType, equals returns false.
Returns:
true if the specified object is equal to this ArrayType instance.
See Also:
Object.hashCode() sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

hashCode sample code for javax.management.openmbean.ArrayType.hashCode() definition code for javax.management.openmbean.ArrayType.hashCode()

public int hashCode()
Returns the hash code value for this ArrayType instance.

The hash code of a ArrayType instance is the sum of the hash codes of all elements of information used in equals comparisons (ie: dimension and elements' type). This ensures that t1.equals(t2) implies that t1.hashCode()==t2.hashCode() for any two ArrayType instances t1 and t2, as required by the general contract of the method Object.hashCode() sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() .

As ArrayType instances are immutable, the hash code for this instance is calculated once, on the first call to hashCode, and then the same value is returned for subsequent calls.

Specified by:
hashCode sample code for javax.management.openmbean.OpenType.hashCode() definition code for javax.management.openmbean.OpenType.hashCode() in class OpenType sample code for javax.management.openmbean.OpenType definition code for javax.management.openmbean.OpenType
Returns:
the hash code value for this ArrayType instance
See Also:
Object.equals(java.lang.Object) sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

toString sample code for javax.management.openmbean.ArrayType.toString() definition code for javax.management.openmbean.ArrayType.toString()

public String sample code for java.lang.String definition code for java.lang.String  toString()
Returns a string representation of this ArrayType instance.

The string representation consists of the name of this class (ie javax.management.openmbean.ArrayType), the type name, the dimension and elements' type defined for this instance,

As ArrayType instances are immutable, the string representation for this instance is calculated once, on the first call to toString, and then the same value is returned for subsequent calls.

Specified by:
toString sample code for javax.management.openmbean.OpenType.toString() definition code for javax.management.openmbean.OpenType.toString() in class OpenType sample code for javax.management.openmbean.OpenType definition code for javax.management.openmbean.OpenType
Returns:
a string representation of this ArrayType instance