javax.management.openmbean
public class TabularType extends OpenType<TabularData>
TabularData
class.ALLOWED_CLASSNAMES, ALLOWED_CLASSNAMES_LIST
Constructor and Description |
---|
TabularType(String name,
String desc,
CompositeType rowType,
String[] indexNames)
Constructs a new
TabularType instance for the given
type name, description, row type and index names. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Compares this tabular data type with another object
for equality.
|
List<String> |
getIndexNames()
Returns an unmodifiable list containing the index names.
|
CompositeType |
getRowType()
Returns the type of the rows used by this tabular data structure.
|
int |
hashCode()
Returns the hash code of the tabular data type.
|
boolean |
isValue(Object obj)
Returns true if the specified object is a member of this
tabular type.
|
String |
toString()
Returns a textual representation of this instance.
|
getClassName, getDescription, getTypeName, isArray
public TabularType(String name, String desc, CompositeType rowType, String[] indexNames) throws OpenDataException
Constructs a new TabularType
instance for the given
type name, description, row type and index names. All parameters
(including the individual elements of the array of index names)
must be non-null and those that are of type String
must be non-empty. The array of index names must also be non-empty.
The result of TabularData.class.getName()
is adopted
as the class name (see OpenType
). The ordering of the array
elements is relevant in determining the indicies of the values in the
table, and thus in the use of the
TabularData.get(java.lang.Object[])
and
TabularData.remove(java.lang.Object[])
methods of the
TabularData
class.
name
- the name of this tabular type.desc
- a description of this tabular type.rowType
- the type of the rows of the table.indexNames
- the names used to index the rows within the table.IllegalArgumentException
- if any validity constraint listed above
is broken.OpenDataException
- if an index name does not match a corresponding
name in the given row type.public boolean equals(Object obj)
Compares this tabular data type with another object for equality. The objects are judged to be equal if:
obj
is not null.obj
is an instance of
TabularType
.equals
in class OpenType<TabularData>
obj
- the object to compare with.Object.hashCode()
public List<String> getIndexNames()
CompositeData
values, and is retained from that
used in the call to this object's constructor.public CompositeType getRowType()
public int hashCode()
Returns the hash code of the tabular data type.
This is computed as the sum of the hash codes of the
index names together with the hash code of the type
name and row type. These are the same elements
of the type that are compared as part of the
equals(java.lang.Object)
method, thus ensuring
that the hashcode is compatible with the equality
test.
As instances of this class are immutable, the hash code is computed just once for each instance and reused throughout its life.
hashCode
in class OpenType<TabularData>
Object.equals(Object)
,
System.identityHashCode(Object)
public boolean isValue(Object obj)
TabularData
with an equivalent
type, according to the definition of
equals(java.lang.Object)
for TabularType
.isValue
in class OpenType<TabularData>
obj
- the object to test for membership.public String toString()
Returns a textual representation of this instance. This
is constructed using the class name
(javax.management.openmbean.TabularType
)
and each element of the instance which is relevant to
the definition of equals(java.lang.Object)
and
hashCode()
(i.e. the type name, the row type
and the index names).
As instances of this class are immutable, the return value is computed just once for each instance and reused throughout its life.
toString
in class OpenType<TabularData>
Object.getClass()
,
Object.hashCode()
,
Class.getName()
,
Integer.toHexString(int)