APIdia Launch Partner
Top Description Fields Constructors Methods
javax.management.openmbean

public Class TabularType

extends OpenType<TabularData>
Class Inheritance
Imports
java.util.ArrayList, .Collections, .List

The TabularType class is the open type class whose instances describe the types of TabularData values.
Since
1.5

Field Summary

Modifier and TypeField and Description
private List<String>
private transient Integer
private transient String
private CompositeType
pack-priv static final long
Inherited from javax.management.openmbean.OpenType:
ALLOWED_CLASSNAMESALLOWED_CLASSNAMES_LIST

Constructor Summary

AccessConstructor and Description
public
TabularType(String
The name given to the tabular type this instance represents; cannot be a null or empty string.
 
typeName
,
String
The human readable description of the tabular type this instance represents; cannot be a null or empty string.
 
description
,
CompositeType
The type of the row elements of tabular data values described by this tabular type instance; cannot be null.
 
rowType
,
String[]
The names of the items the values of which are used to uniquely index each row element in the tabular data values described by this tabular type instance; cannot be null or empty. Each element should be an item name defined in rowType (no null or empty string allowed). It is important to note that the order of the item names in indexNames is used by the methods get and remove of class TabularData to match their array of values parameter to items.
 
indexNames
)

Constructs a TabularType instance, checking for the validity of the given parameters.

Method Summary

Modifier and TypeMethod and Description
private static void
checkForEmptyString(String[] arg, String argName)

Checks that String[] does not contain any empty (or blank characters only) string.

private static void
checkForNullElement(Object[] arg, String argName)

Checks that Object[] arg is neither null nor empty (ie length==0) and that it does not contain any null element.

public boolean

Returns:

true if the specified object is equal to this TabularType instance.
equals
(Object
the object to be compared for equality with this TabularType instance; if obj is null, equals returns false.
obj
)

Implements abstract javax.management.openmbean.OpenType.equals.

Compares the specified obj parameter with this TabularType instance for equality.

public List<String>

Returns:

a List of String representing the names of the index items.
getIndexNames
()

Returns, in the same order as was given to this instance's constructor, an unmodifiable List of the names of the items the values of which are used to uniquely index each row element of tabular data values described by this TabularType instance.

public CompositeType

Returns:

the type of each row.
getRowType
()

Returns the type of the row elements of tabular data values described by this TabularType instance.

public int

Returns:

the hash code value for this TabularType instance
hashCode
()

Implements abstract javax.management.openmbean.OpenType.hashCode.

Returns the hash code value for this TabularType instance.

pack-priv boolean
isAssignableFrom(OpenType<?> ot)

Overrides javax.management.openmbean.OpenType.isAssignableFrom.

Tests whether values of the given type can be assigned to this open type.

public boolean

Returns:

true if obj is a value for this tabular type, false otherwise.
isValue
(Object
the value whose open type is to be tested for compatibility with this TabularType instance.
obj
)

Implements abstract javax.management.openmbean.OpenType.isValue.

Tests whether obj is a value which could be described by this TabularType instance.

public String

Returns:

a string representation of this TabularType instance
toString
()

Implements abstract javax.management.openmbean.OpenType.toString.

Returns a string representation of this TabularType instance.

Inherited from javax.management.openmbean.OpenType:
getClassNamegetDescriptiongetDescriptorgetTypeNameisArraysafeGetClassName

Field Detail

indexNamesback to summary
private List<String> indexNames
Annotations
@SuppressWarnings:serial
myHashCodeback to summary
private transient Integer myHashCode
myToStringback to summary
private transient String myToString
rowTypeback to summary
private CompositeType rowType
serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides javax.management.openmbean.OpenType.serialVersionUID.

Constructor Detail

TabularTypeback to summary
public TabularType(String typeName, String description, CompositeType rowType, String[] indexNames) throws OpenDataException

Constructs a TabularType instance, checking for the validity of the given parameters. The validity constraints are described below for each parameter.

The Java class name of tabular data values this tabular type represents (ie the class name returned by the getClassName method) is set to the string value returned by TabularData.class.getName().

Parameters
typeName:String

The name given to the tabular type this instance represents; cannot be a null or empty string.
 

description:String

The human readable description of the tabular type this instance represents; cannot be a null or empty string.
 

rowType:CompositeType

The type of the row elements of tabular data values described by this tabular type instance; cannot be null.
 

indexNames:String[]

The names of the items the values of which are used to uniquely index each row element in the tabular data values described by this tabular type instance; cannot be null or empty. Each element should be an item name defined in rowType (no null or empty string allowed). It is important to note that the order of the item names in indexNames is used by the methods get and remove of class TabularData to match their array of values parameter to items.
 

Exceptions
OpenDataException:
if an element's value of indexNames is not an item name defined in rowType.
IllegalArgumentException:
if rowType is null, or indexNames is a null or empty array, or an element in indexNames is a null or empty string, or typeName or description is a null or empty string.
 

Method Detail

checkForEmptyStringback to summary
private static void checkForEmptyString(String[] arg, String argName)

Checks that String[] does not contain any empty (or blank characters only) string.

checkForNullElementback to summary
private static void checkForNullElement(Object[] arg, String argName)

Checks that Object[] arg is neither null nor empty (ie length==0) and that it does not contain any null element.

equalsback to summary
public boolean equals(Object obj)

Implements abstract javax.management.openmbean.OpenType.equals.

Compares the specified obj parameter with this TabularType instance for equality.

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

  • their type names are equal
  • their row types are equal
  • they use the same index names, in the same order

 
Parameters
obj:Object

the object to be compared for equality with this TabularType instance; if obj is null, equals returns false.

Returns:boolean

true if the specified object is equal to this TabularType instance.

getIndexNamesback to summary
public List<String> getIndexNames()

Returns, in the same order as was given to this instance's constructor, an unmodifiable List of the names of the items the values of which are used to uniquely index each row element of tabular data values described by this TabularType instance.

Returns:List<String>

a List of String representing the names of the index items.

getRowTypeback to summary
public CompositeType getRowType()

Returns the type of the row elements of tabular data values described by this TabularType instance.

Returns:CompositeType

the type of each row.

hashCodeback to summary
public int hashCode()

Implements abstract javax.management.openmbean.OpenType.hashCode.

Returns the hash code value for this TabularType instance.

The hash code of a TabularType instance is the sum of the hash codes of all elements of information used in equals comparisons (ie: name, row type, index names). This ensures that t1.equals(t2) implies that t1.hashCode()==t2.hashCode() for any two TabularType instances t1 and t2, as required by the general contract of the method Object.hashCode().

As TabularType 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.

Returns:int

the hash code value for this TabularType instance

isAssignableFromback to summary
pack-priv boolean isAssignableFrom(OpenType<?> ot)

Overrides javax.management.openmbean.OpenType.isAssignableFrom.

Doc from javax.management.openmbean.OpenType.isAssignableFrom.

Tests whether values of the given type can be assigned to this open type. The default implementation of this method returns true only if the types are equal.

Annotations
@Override
isValueback to summary
public boolean isValue(Object obj)

Implements abstract javax.management.openmbean.OpenType.isValue.

Tests whether obj is a value which could be described by this TabularType instance.

If obj is null or is not an instance of javax.management.openmbean.TabularData, isValue returns false.

If obj is an instance of javax.management.openmbean.TabularData, say td, the result is true if this TabularType is assignable from td.getTabularType(), as defined in CompositeType.isValue.

Parameters
obj:Object

the value whose open type is to be tested for compatibility with this TabularType instance.

Returns:boolean

true if obj is a value for this tabular type, false otherwise.

toStringback to summary
public String toString()

Implements abstract javax.management.openmbean.OpenType.toString.

Returns a string representation of this TabularType instance.

The string representation consists of the name of this class (ie javax.management.openmbean.TabularType), the type name for this instance, the row type string representation of this instance, and the index names of this instance.

As TabularType 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.

Returns:String

a string representation of this TabularType instance