|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Tuple
A Tuple is a data structure that holds primitive attributes and associations (relationships) to other tuples. The metadata for the Tuple is contained in the associated TupleMetadata.
Tuple instances are created using the TupleMetadata.createTuple()
method.
The Tuple interface should not be directly implemented.
Method Summary | |
---|---|
void |
addAssociationKey(int position,
Tuple key)
Add a single association key for an association. |
void |
addAssociationKeys(int position,
Tuple[] keys)
Add multiple association keys for an association. |
boolean |
equals(Object object)
Indicates whether a Tuple is "equal to" this one. |
Tuple |
getAssociation(int position,
int index)
Retrieve the association Tuple key from the specified position and index. |
Tuple[] |
getAssociations(int position)
Retrieve all association Tuple keys from the specified position. |
int |
getAssociationSize(int position)
Retrieve the number of association keys for an association. |
Object |
getAttribute(int position)
Retreive an attribute value from the specified position. |
TupleMetadata |
getMetadata()
This returns the metadata for this tuple. |
int |
hashCode()
Returns the hash code value for this Tuple. |
Object |
setAttribute(int position,
Object value)
Set the attribute value at the specified position. |
void |
setAttributes(Object[] values)
Set the attribute values at the specified positions. |
Method Detail |
---|
TupleMetadata getMetadata()
Object getAttribute(int position)
position
- the position of the attribute within this tuple.
IndexOutOfBoundsException
- if the position is greater than TupleMetadata.getNumAttributes()
-1 or less than 0.Object setAttribute(int position, Object value)
position
- the position of the attribute within this tuple.value
- the value to set the attribute to.
IndexOutOfBoundsException
- if the position is greater than TupleMetadata.getNumAttributes()
-1 or less than 0.void setAttributes(Object[] values)
values
- the values to set each attribute to.
IndexOutOfBoundsException
- if the input array size is greater than TupleMetadata.getNumAttributes()
.Tuple getAssociation(int position, int index)
position
- the position of the association key(s) within this tuple.index
- the index of an association key for a given association.
IndexOutOfBoundsException
- if the position is greater than TupleMetadata.getNumAssociations()()
-1 or less than 0 or if the
index is greater than getAssociationSize(int)
or less than 0;Tuple[] getAssociations(int position)
position
- the position of the association key(s) within this tuple.
IndexOutOfBoundsException
- if the position is greater than TupleMetadata.getNumAssociations()()
-1 or less than 0.void addAssociationKey(int position, Tuple key)
position
- the position of the association key(s) within this tuple.key
- the Tuple key to add to the current association.
IndexOutOfBoundsException
- if the position is greater than TupleMetadata.getNumAssociations()()
-1 or less than 0.void addAssociationKeys(int position, Tuple[] keys)
position
- the position of the association key(s) within this tuple.keys
- the Tuple keys to add to the current association.
IndexOutOfBoundsException
- if the position is greater than TupleMetadata.getNumAssociations()()
-1 or less than 0.int getAssociationSize(int position)
position
- the position of the association key(s) within this tuple.
boolean equals(Object object)
Tuples are equal if the attributes and associations are equal.
Attribute equality is determined by using the equals method on each attribute. Array attributes return true if they are "deeply equal". Each element in the array is checked for equality as a normal attribute. Nested arrays are therefore checked for equality.
Association equality is determined by using the equals method on each association key Tuple. If the association is a OneToMany or ManyToMany relationship, the keys are compared using the order in which the keys were added to the association.
equals
in class Object
object
- the reference Tuple with which to compare.
true
if this object is the same as the object
argument; false
otherwise.hashCode()
,
Hashtable
int hashCode()
Object.hashCode()
and is calculated based on the attributes and association keys within
this tuple as described in the equals method.
hashCode
in class Object
Object.equals(java.lang.Object)
,
Hashtable
|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |