| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
TabularType tabularType = …;
TabularDataSupport data = new TabularDataSupport(tabularType);
Based on 23 examples
public class TabularDataSupport extends Object implements TabularData, Map, Cloneable, Serializable
The TabularDataSupport class is the open data class which implements the TabularData and the Map interfaces, and which is internally based on a hash map data structure.
Constructor Summary | |
---|---|
TabularDataSupport(TabularType tabularType) Creates an empty TabularDataSupport instance whose open-type is tabularType, and whose underlying HashMap has a default initial capacity (101) and default load factor (0.75). |
|
TabularDataSupport(TabularType tabularType, int initialCapacity, float loadFactor) Creates an empty TabularDataSupport instance whose open-type is tabularType, and whose underlying HashMap has the specified initial capacity and load factor. |
Method Summary | |
---|---|
Object[] |
calculateIndex(CompositeData value) Calculates the index that would be used in this TabularData instance to refer to the specified composite data value parameter if it were added to this instance. |
void |
clear() Removes all rows from this TabularDataSupport instance.
|
Object |
clone() Returns a clone of this TabularDataSupport instance:
the clone is obtained by calling super.clone(), and then cloning the underlying map.
|
boolean |
containsKey(Object key) Returns true if and only if this TabularData instance contains a CompositeData value (ie a row) whose index is the specified key. |
boolean |
containsKey(Object[] key) Returns true if and only if this TabularData instance contains a CompositeData value (ie a row) whose index is the specified key. |
boolean |
containsValue(CompositeData value) Returns true if and only if this TabularData instance contains the specified CompositeData value. |
boolean |
containsValue(Object value) Returns true if and only if this TabularData instance contains the specified value. |
Set |
entrySet() Returns a collection view of the index to row mappings contained in this instance. |
boolean |
Compares the specified obj parameter with this TabularDataSupport instance for equality.
|
Object |
This method simply calls get((Object[]) key). |
CompositeData |
Returns the CompositeData value whose index is key, or null if there is no value mapping to key, in this TabularData instance. |
TabularType |
Returns the tabular type describing this TabularData instance. |
int |
hashCode() Returns the hash code value for this TabularDataSupport instance.
|
boolean |
isEmpty() Returns true if this TabularDataSupport instance contains no rows.
|
Set |
keySet() Returns a set view of the keys contained in the underlying map of this instance used to index the rows. |
void |
put(CompositeData value) |
Object |
This method simply calls put((CompositeData) value) and therefore ignores its key parameter which can be null. |
void |
putAll(CompositeData[] values) Add all the elements in values to this TabularData instance. |
void |
Add all the values contained in the specified map t to this TabularData instance. |
Object |
This method simply calls remove((Object[]) key). |
CompositeData |
Removes the CompositeData value whose index is key from this TabularData instance, and returns the removed value, or returns null if there is no value whose index is key. |
int |
size() Returns the number of rows in this TabularDataSupport instance.
|
String |
toString() Returns a string representation of this TabularDataSupport instance.
|
Collection |
values() Returns a collection view of the rows contained in this instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TabularDataSupport(TabularType tabularType)
This constructor simply calls this(tabularType, 101, 0.75f);
tabularType
- the tabular type describing this TabularData instance;
cannot be null.public TabularDataSupport(TabularType tabularType, int initialCapacity, float loadFactor)
tabularType
- the tabular type describing this TabularData instance;
cannot be null.initialCapacity
- the initial capacity of the HashMap.loadFactor
- the load factor of the HashMapMethod Detail |
---|
public Object[] calculateIndex(CompositeData value)
value
- the composite data value whose index in this
TabularData instance is to be calculated;
must be of the same composite type as this instance's row type;
must not be null.public void clear()
TabularDataSupport
instance.
public Object clone()
TabularDataSupport
instance:
the clone is obtained by calling super.clone(), and then cloning the underlying map.
Only a shallow clone of the underlying map is made, i.e. no cloning of the indexes and row values is made as they are immutable.
clone
in class Object
public boolean containsKey(Object key)
key
- the index value whose presence in this TabularData instance is to be tested.public boolean containsKey(Object[] key)
key
- the index value whose presence in this TabularData instance is to be tested.public boolean containsValue(CompositeData value)
value
- the row value whose presence in this TabularData instance is to be tested.public boolean containsValue(Object value)
value
- the row value whose presence in this TabularData instance is to be tested.public Set entrySet()
public boolean equals(Object obj)
TabularDataSupport
instance for equality.
Returns true if and only if all of the following statements are true:
TabularData
interface,TabularData
interface.
equals
in class Object
obj
- the object to be compared for equality with this TabularDataSupport
instance;true
if the specified object is equal to this TabularDataSupport
instance.public Object get(Object key)
key
public CompositeData get(Object[] key)
key
- the index of the value to get in this
TabularData instance; * must be valid with this
TabularData instance's row type definition; * must not
be null.public TabularType getTabularType()
public int hashCode()
TabularDataSupport
instance.
The hash code of a TabularDataSupport
instance is the sum of the hash codes
of all elements of information used in equals
comparisons
(ie: its tabular type and its content, where the content is defined as all the CompositeData values).
This ensures that t1.equals(t2)
implies that t1.hashCode()==t2.hashCode()
for any two TabularDataSupport
instances t1
and t2
,
as required by the general contract of the method
{@link Object#hashCode() Object.hashCode()}.
However, note that another instance of a class implementing the TabularData
interface
may be equal to this TabularDataSupport
instance as defined by {@link #equals},
but may have a different hash code if it is calculated differently.
hashCode
in class Object
TabularDataSupport
instancepublic boolean isEmpty()
TabularDataSupport
instance contains no rows.
TabularDataSupport
instance contains no rows.public Set keySet()
public void put(CompositeData value)
value
public Object put(Object key, Object value)
key
- an ignored parameter.value
- the {@link CompositeData} to put.public void putAll(CompositeData[] values)
values
- the array of composite data values to be added as
new rows to this TabularData instance; if
values is null or empty, this method
returns without doing anything.public void putAll(Map t)
t
- the map whose values are to be added as new rows to
this TabularData instance; if t is
null or empty, this method returns without doing
anything.public Object remove(Object key)
key
- an Object[] representing the key to remove.public CompositeData remove(Object[] key)
key
- the index of the value to get in this TabularData instance;
must be valid with this TabularData instance's row type definition;
must not be null.public int size()
TabularDataSupport
instance.
TabularDataSupport
instance.public String toString()
TabularDataSupport
instance.
The string representation consists of the name of this class (ie javax.management.openmbean.TabularDataSupport
),
the string representation of the tabular type of this instance, and the string representation of the contents
(ie list the key=value mappings as returned by a call to
dataMap.{@link java.util.HashMap#toString() toString()}).
toString
in class Object
TabularDataSupport
instancepublic Collection values()
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |