站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 jmx API Documentation 英文版文档

CompositeDataSupport (JBoss/JMX API) - JBoss 4.0.1 sp1 jmx API Documentation 英文版文档


javax.management.openmbean
Class CompositeDataSupport

java.lang.Object
  extended byjavax.management.openmbean.CompositeDataSupport
All Implemented Interfaces:
CompositeData, Serializable

public class CompositeDataSupport
extends Object
implements CompositeData, Serializable

An implementation of CompositeData.

Version:
$Revision: 1.7 $
Author:
Adrian Brock, Thomas Diesler.
See Also:
Serialized Form

Constructor Summary
CompositeDataSupport(CompositeType compositeType, Map items)
          Construct Composite Data
CompositeDataSupport(CompositeType compositeType, String[] itemNames, Object[] itemValues)
          Construct Composite Data
 
Method Summary
 boolean containsKey(String key)
          Tests whether a key is part of this composite data
 boolean containsValue(Object value)
          Tests whether a item exists with the passed value
 boolean equals(Object obj)
          Tests whether two composite data objects are equal
 Object get(String key)
          Retrieve the value for the item with the passed key
 Object[] getAll(String[] keys)
          Returns an array of the values of the items whose names are specified by keys, in the same order as keys.
 CompositeType getCompositeType()
          Retrieve the composite type for this composite data
 int hashCode()
          Returns the hash code value for this CompositeDataSupport instance.
 String toString()
          Returns a string representation of this CompositeDataSupport instance.
 Collection values()
          The values of this composite data
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompositeDataSupport

public CompositeDataSupport(CompositeType compositeType,
                            String[] itemNames,
                            Object[] itemValues)
                     throws OpenDataException
Construct Composite Data

Parameters:
compositeType - the composite type of the data
itemNames - the names of the values
itemValues - the values
Throws:
IllegalArgumentException - for a null or empty argument
OpenDataException - when the items do not match the CompositeType

CompositeDataSupport

public CompositeDataSupport(CompositeType compositeType,
                            Map items)
                     throws OpenDataException
Construct Composite Data

Parameters:
compositeType - the composite type of the data
items - map of strings to values
Throws:
IllegalArgumentException - for a null or empty argument
OpenDataException - when the items do not match the CompositeType
ArrayStoreException - when a key to the map is not a String
Method Detail

getCompositeType

public CompositeType getCompositeType()
Description copied from interface: CompositeData
Retrieve the composite type for this composite data

Specified by:
getCompositeType in interface CompositeData
Returns:
the composite type

get

public Object get(String key)
Description copied from interface: CompositeData
Retrieve the value for the item with the passed key

Specified by:
get in interface CompositeData
Returns:
the value

getAll

public Object[] getAll(String[] keys)
Returns an array of the values of the items whose names are specified by keys, in the same order as keys.

Specified by:
getAll in interface CompositeData
Returns:
the array of values

containsKey

public boolean containsKey(String key)
Description copied from interface: CompositeData
Tests whether a key is part of this composite data

Specified by:
containsKey in interface CompositeData
Returns:
true when the key exists, false otherwise

containsValue

public boolean containsValue(Object value)
Description copied from interface: CompositeData
Tests whether a item exists with the passed value

Specified by:
containsValue in interface CompositeData
Returns:
true when the value exists, false otherwise

values

public Collection values()
Description copied from interface: CompositeData
The values of this composite data

An iterator over the returned collection returns result in ascending lexicographic order

Specified by:
values in interface CompositeData
Returns:
an unmodifiable Collection of the values of this CompositeType.

equals

public boolean equals(Object obj)
Description copied from interface: CompositeData
Tests whether two composite data objects are equal

The object is non-null
The object implements this interface
The composite types are equal
The values are equal

Specified by:
equals in interface CompositeData

hashCode

public int hashCode()
Returns the hash code value for this CompositeDataSupport instance. The hash code of a CompositeDataSupport instance is the sum of the hash codes of all elements of information used in equals comparisons (ie: its composite type and all the item values). This ensures that t1.equals(t2) implies that t1.hashCode()==t2.hashCode() for any two CompositeDataSupport instances t1 and t2, as required by the general contract of the method Object.hashCode . However, note that another instance of a class implementing the CompositeData interface may be equal to this CompositeDataSupport instance as defined by equals(java.lang.Object), but may have a different hash code if it is calculated differently.

Specified by:
hashCode in interface CompositeData

toString

public String toString()
Returns a string representation of this CompositeDataSupport instance. The string representation consists of the name of this class (ie javax.management.openmbean.CompositeDataSupport), the string representation of the composite type of this instance, and the string representation of the contents (ie list the itemName=itemValue mappings).

Specified by:
toString in interface CompositeData


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.