javax.management.openmbean
Class CompositeType

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.CompositeType
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable

public class CompositeType
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 CompositeType class is the open type class whose instances describe the types of CompositeData sample code for javax.management.openmbean.CompositeData definition code for javax.management.openmbean.CompositeData 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
CompositeType sample code for javax.management.openmbean.CompositeType.CompositeType(java.lang.String, java.lang.String, java.lang.String[], java.lang.String[], javax.management.openmbean.OpenType[]) definition code for javax.management.openmbean.CompositeType.CompositeType(java.lang.String, java.lang.String, java.lang.String[], java.lang.String[], javax.management.openmbean.OpenType[]) (String sample code for java.lang.String definition code for java.lang.String  typeName, String sample code for java.lang.String definition code for java.lang.String  description, String sample code for java.lang.String definition code for java.lang.String [] itemNames, String sample code for java.lang.String definition code for java.lang.String [] itemDescriptions, OpenType sample code for javax.management.openmbean.OpenType definition code for javax.management.openmbean.OpenType [] itemTypes)
          Constructs a CompositeType instance, checking for the validity of the given parameters.
 
Method Summary
 boolean containsKey sample code for javax.management.openmbean.CompositeType.containsKey(java.lang.String) definition code for javax.management.openmbean.CompositeType.containsKey(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  itemName)
          Returns true if this CompositeType instance defines an item whose name is itemName.
 boolean equals sample code for javax.management.openmbean.CompositeType.equals(java.lang.Object) definition code for javax.management.openmbean.CompositeType.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 CompositeType instance for equality.
 String sample code for java.lang.String definition code for java.lang.String getDescription sample code for javax.management.openmbean.CompositeType.getDescription(java.lang.String) definition code for javax.management.openmbean.CompositeType.getDescription(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  itemName)
          Returns the description of the item whose name is itemName, or null if this CompositeType instance does not define any item whose name is itemName.
 OpenType sample code for javax.management.openmbean.OpenType definition code for javax.management.openmbean.OpenType getType sample code for javax.management.openmbean.CompositeType.getType(java.lang.String) definition code for javax.management.openmbean.CompositeType.getType(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  itemName)
          Returns the open type of the item whose name is itemName, or null if this CompositeType instance does not define any item whose name is itemName.
 int hashCode sample code for javax.management.openmbean.CompositeType.hashCode() definition code for javax.management.openmbean.CompositeType.hashCode() ()
          Returns the hash code value for this CompositeType instance.
 boolean isValue sample code for javax.management.openmbean.CompositeType.isValue(java.lang.Object) definition code for javax.management.openmbean.CompositeType.isValue(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  obj)
          Tests whether obj is a value which could be described by this CompositeType instance.
 Set sample code for java.util.Set definition code for java.util.Set keySet sample code for javax.management.openmbean.CompositeType.keySet() definition code for javax.management.openmbean.CompositeType.keySet() ()
          Returns an unmodifiable Set view of all the item names defined by this CompositeType instance.
 String sample code for java.lang.String definition code for java.lang.String toString sample code for javax.management.openmbean.CompositeType.toString() definition code for javax.management.openmbean.CompositeType.toString() ()
          Returns a string representation of this CompositeType 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

CompositeType sample code for javax.management.openmbean.CompositeType(java.lang.String, java.lang.String, java.lang.String[], java.lang.String[], javax.management.openmbean.OpenType[]) definition code for javax.management.openmbean.CompositeType(java.lang.String, java.lang.String, java.lang.String[], java.lang.String[], javax.management.openmbean.OpenType[])

public CompositeType(String sample code for java.lang.String definition code for java.lang.String  typeName,
                     String sample code for java.lang.String definition code for java.lang.String  description,
                     String sample code for java.lang.String definition code for java.lang.String [] itemNames,
                     String sample code for java.lang.String definition code for java.lang.String [] itemDescriptions,
                     OpenType sample code for javax.management.openmbean.OpenType definition code for javax.management.openmbean.OpenType [] itemTypes)
              throws OpenDataException sample code for javax.management.openmbean.OpenDataException definition code for javax.management.openmbean.OpenDataException 
Constructs a CompositeType instance, checking for the validity of the given parameters. The validity constraints are described below for each parameter.

Note that the contents of the three array parameters itemNames, itemDescriptions and itemTypes are internally copied so that any subsequent modification of these arrays by the caller of this constructor has no impact on the constructed CompositeType instance.

The Java class name of composite data values this composite type represents (ie the class name returned by the getClassName sample code for javax.management.openmbean.OpenType.getClassName() definition code for javax.management.openmbean.OpenType.getClassName() method) is set to the string value returned by CompositeData.class.getName().

Parameters:
typeName - The name given to the composite type this instance represents; cannot be a null or empty string.
 
description - The human readable description of the composite type this instance represents; cannot be a null or empty string.
 
itemNames - The names of the items contained in the composite data values described by this CompositeType instance; cannot be null and should contain at least one element; no element can be a null or empty string. Note that the order in which the item names are given is not important to differentiate a CompositeType instance from another; the item names are internally stored sorted in ascending alphanumeric order.
 
itemDescriptions - The descriptions, in the same order as itemNames, of the items contained in the composite data values described by this CompositeType instance; should be of the same size as itemNames; no element can be a null or empty string.
 
itemTypes - The open type instances, in the same order as itemNames, describing the items contained in the composite data values described by this CompositeType instance; should be of the same size as itemNames; no element can be null.
 
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - If typeName or description is a null or empty string, or itemNames or itemDescriptions or itemTypes is null, or any element of itemNames or itemDescriptions is a null or empty string, or any element of itemTypes is null, or itemNames or itemDescriptions or itemTypes are not of the same size.
 
OpenDataException sample code for javax.management.openmbean.OpenDataException definition code for javax.management.openmbean.OpenDataException - If itemNames contains duplicate item names (case sensitive, but leading and trailing whitespaces removed).
Method Detail

containsKey sample code for javax.management.openmbean.CompositeType.containsKey(java.lang.String) definition code for javax.management.openmbean.CompositeType.containsKey(java.lang.String)

public boolean containsKey(String sample code for java.lang.String definition code for java.lang.String  itemName)
Returns true if this CompositeType instance defines an item whose name is itemName.

Parameters:
itemName - the name of the item.
Returns:
true if an item of this name is present.

getDescription sample code for javax.management.openmbean.CompositeType.getDescription(java.lang.String) definition code for javax.management.openmbean.CompositeType.getDescription(java.lang.String)

public String sample code for java.lang.String definition code for java.lang.String  getDescription(String sample code for java.lang.String definition code for java.lang.String  itemName)
Returns the description of the item whose name is itemName, or null if this CompositeType instance does not define any item whose name is itemName.

Parameters:
itemName - the name of the item.
Returns:
the description.

getType sample code for javax.management.openmbean.CompositeType.getType(java.lang.String) definition code for javax.management.openmbean.CompositeType.getType(java.lang.String)

public OpenType sample code for javax.management.openmbean.OpenType definition code for javax.management.openmbean.OpenType  getType(String sample code for java.lang.String definition code for java.lang.String  itemName)
Returns the open type of the item whose name is itemName, or null if this CompositeType instance does not define any item whose name is itemName.

Parameters:
itemName - the name of the time.
Returns:
the type.

keySet sample code for javax.management.openmbean.CompositeType.keySet() definition code for javax.management.openmbean.CompositeType.keySet()

public Set sample code for java.util.Set definition code for java.util.Set  keySet()
Returns an unmodifiable Set view of all the item names defined by this CompositeType instance. The set's iterator will return the item names in ascending order.

Returns:
a Set sample code for java.util.Set definition code for java.util.Set of String sample code for java.lang.String definition code for java.lang.String .

isValue sample code for javax.management.openmbean.CompositeType.isValue(java.lang.Object) definition code for javax.management.openmbean.CompositeType.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 which could be described by this CompositeType instance.

If obj is null or is not an instance of javax.management.openmbean.CompositeData, isValue returns false. If obj is an instance of javax.management.openmbean.CompositeData, its composite type is tested for equality with this CompositeType instance, and isValue returns true if and only if equals sample code for javax.management.openmbean.CompositeType.equals(java.lang.Object) definition code for javax.management.openmbean.CompositeType.equals(java.lang.Object) returns 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 value whose open type is to be tested for equality with this CompositeType instance.
Returns:
true if obj is a value for this composite type, false otherwise.

equals sample code for javax.management.openmbean.CompositeType.equals(java.lang.Object) definition code for javax.management.openmbean.CompositeType.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 CompositeType instance for equality.

Two CompositeType instances are equal if and only if all of the following statements are true:


 

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 CompositeType instance; if obj is null, equals returns false.
Returns:
true if the specified object is equal to this CompositeType 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.CompositeType.hashCode() definition code for javax.management.openmbean.CompositeType.hashCode()

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

The hash code of a CompositeType instance is the sum of the hash codes of all elements of information used in equals comparisons (ie: name, items names, items types). This ensures that t1.equals(t2) implies that t1.hashCode()==t2.hashCode() for any two CompositeType 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 CompositeType 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 CompositeType 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.CompositeType.toString() definition code for javax.management.openmbean.CompositeType.toString()

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

The string representation consists of the name of this class (ie javax.management.openmbean.CompositeType), the type name for this instance, and the list of the items names and types string representation of this instance.

As CompositeType 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 CompositeType instance