javax.management.openmbean
Class TabularDataSupport

java.lang.Object
  extended byjavax.management.openmbean.TabularDataSupport
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable, TabularData (src)

public class TabularDataSupport
extends java.lang.Object
implements java.lang.Cloneable, java.util.Map, java.io.Serializable, TabularData (src)

An implementation of TabularData.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Constructor Summary
TabularDataSupport(TabularType (src)  tabularType)
          Construct Tabular Data with an initial capacity of 101 and a load factor of 0.75
TabularDataSupport(TabularType (src)  tabularType, int initialCapacity, float loadFactor)
          Construct Tabular Data
 
Method Summary
 java.lang.Object[] calculateIndex(CompositeData (src)  value)
          Calculate the index for the value passed if it were added to the tabular data.
 void clear()
          Removes all CompositeData values from the Tabular Data
 java.lang.Object clone()
           
 boolean containsKey(java.lang.Object key)
           
 boolean containsKey(java.lang.Object[] key)
          Determine whether the tabular data contains the passed value as a row.
 boolean containsValue(CompositeData (src)  value)
          Determine whether the tabular data contains the passed value.
 boolean containsValue(java.lang.Object value)
           
 java.util.Set entrySet()
           
 boolean equals(java.lang.Object obj)
          Compares the specified obj parameter with this TabularDataSupport instance for equality.
 java.lang.Object get(java.lang.Object key)
           
 CompositeData (src) get(java.lang.Object[] key)
          Retrieve the composite data for the passed index.
 TabularType (src) getTabularType()
          Retrieve the tabular type for this tabular data
 int hashCode()
          Generates a hashcode for the implementation.
 boolean isEmpty()
          Determine whether the tabular data is empty.
 java.util.Set keySet()
          Returns a set view of the index values.
 void put(CompositeData (src)  value)
          Add a value to the tabular data.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
           
 void putAll(CompositeData (src) [] values)
          Add all the passed values.
 void putAll(java.util.Map t)
           
 java.lang.Object remove(java.lang.Object key)
           
 CompositeData (src) remove(java.lang.Object[] key)
          Removes the value for the passed and returns the removed value, or null if the key was not present.
 int size()
          Retrieve the number of rows in the tabular data.
 java.lang.String toString()
          A string representation of the open mbean operation info.
 java.util.Collection values()
          Returns a set view of the row values.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TabularDataSupport

public TabularDataSupport(TabularType (src)  tabularType)
Construct Tabular Data with an initial capacity of 101 and a load factor of 0.75

Parameters:
tabularType - the tabular type of the data
Throws:
java.lang.IllegalArgumentException - for a null argument

TabularDataSupport

public TabularDataSupport(TabularType (src)  tabularType,
                          int initialCapacity,
                          float loadFactor)
Construct Tabular Data

Parameters:
tabularType - the tabular type of the data
initialCapacity - the initial capacity of the map
loadFactor - the load factory of the map
Throws:
java.lang.IllegalArgumentException - for a null argument
Method Detail

getTabularType

public TabularType (src)  getTabularType()
Description copied from interface: TabularData (src)
Retrieve the tabular type for this tabular data

Specified by:
getTabularType in interface TabularData (src)
Returns:
the tabular type

calculateIndex

public java.lang.Object[] calculateIndex(CompositeData (src)  value)
Description copied from interface: TabularData (src)
Calculate the index for the value passed if it were added to the tabular data. The validity of the passed value is checked. But the tabular data isn't checked to see whether the index is already used.

Specified by:
calculateIndex in interface TabularData (src)
Parameters:
value - the value for which the index is calculated.
Returns:
the calculated index

clear

public void clear()
Description copied from interface: TabularData (src)
Removes all CompositeData values from the Tabular Data

Specified by:
clear in interface java.util.Map

containsKey

public boolean containsKey(java.lang.Object[] key)
Description copied from interface: TabularData (src)
Determine whether the tabular data contains the passed value as a row. If the passed value is null or invalid, false is returned.

Specified by:
containsKey in interface TabularData (src)
Parameters:
key - the value to check
Returns:
true when the value is a row index, false otherwise

containsValue

public boolean containsValue(CompositeData (src)  value)
Description copied from interface: TabularData (src)
Determine whether the tabular data contains the passed value. If the passed value is null or invalid, false is returned.

Specified by:
containsValue in interface TabularData (src)
Parameters:
value - the value to check
Returns:
true when the value is a row index, false otherwise

get

public CompositeData (src)  get(java.lang.Object[] key)
Description copied from interface: TabularData (src)
Retrieve the composite data for the passed index.

Specified by:
get in interface TabularData (src)
Parameters:
key - the index to retrieve

isEmpty

public boolean isEmpty()
Description copied from interface: TabularData (src)
Determine whether the tabular data is empty.

Specified by:
isEmpty in interface java.util.Map

keySet

public java.util.Set keySet()
Description copied from interface: TabularData (src)
Returns a set view of the index values.

Specified by:
keySet in interface java.util.Map

put

public void put(CompositeData (src)  value)
Description copied from interface: TabularData (src)
Add a value to the tabular data. The value must have the same CompositeType has the tabular data and there is no value already occupying the index for the value.

Specified by:
put in interface TabularData (src)
Parameters:
value - the value to add

putAll

public void putAll(CompositeData (src) [] values)
Description copied from interface: TabularData (src)
Add all the passed values. All the values are checked before addition including any duplicates that might be added. Either all or no value is added.

Specified by:
putAll in interface TabularData (src)
Parameters:
values - the values to add

remove

public CompositeData (src)  remove(java.lang.Object[] key)
Description copied from interface: TabularData (src)
Removes the value for the passed and returns the removed value, or null if the key was not present.

Specified by:
remove in interface TabularData (src)
Parameters:
key - the index of the value to remove

size

public int size()
Description copied from interface: TabularData (src)
Retrieve the number of rows in the tabular data.

Specified by:
size in interface java.util.Map

values

public java.util.Collection values()
Description copied from interface: TabularData (src)
Returns a set view of the row values.

Specified by:
values in interface java.util.Map

containsKey

public boolean containsKey(java.lang.Object key)
Specified by:
containsKey in interface java.util.Map

containsValue

public boolean containsValue(java.lang.Object value)
Specified by:
containsValue in interface java.util.Map

entrySet

public java.util.Set entrySet()
Specified by:
entrySet in interface java.util.Map

get

public java.lang.Object get(java.lang.Object key)
Specified by:
get in interface java.util.Map

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Specified by:
put in interface java.util.Map

putAll

public void putAll(java.util.Map t)
Specified by:
putAll in interface java.util.Map

remove

public java.lang.Object remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map

clone

public java.lang.Object clone()

equals

public boolean equals(java.lang.Object obj)
Compares the specified obj parameter with this TabularDataSupport instance for equality. Returns true if and only if all of the following statements are true: - obj is non null, - obj also implements the TabularData interface, - their tabular types are equal - their contents (ie all CompositeData values) are equal. This ensures that this equals method works properly for obj parameters which are different implementations of the TabularData interface.

Specified by:
equals in interface java.util.Map

hashCode

public int hashCode()
Description copied from interface: TabularData (src)
Generates a hashcode for the implementation.

The sum of the hashCodes for the elements mentioned in the equals method

Specified by:
hashCode in interface java.util.Map

toString

public java.lang.String toString()
Description copied from interface: TabularData (src)
A string representation of the open mbean operation info.

It is made up of implementation class and the values mentioned in the equals method

Specified by:
toString in interface TabularData (src)