Class CompositeKey
Key class that consists of a primary and secondary component. Two instances of CompositeKey are considered to be equal iff both the primary and secondary components of the two instances are considered equal. Additionally, the hash code of a CompositeKey takes into the consideration the hash codes of its two components. Finally, the CompositeKey class implements KeyAssociation by returning the primary component.
Inherited Members
Namespace: Tangosol.Util
Assembly: Coherence.dll
Syntax
public class CompositeKey : IPortableObject, IKeyAssociation
Constructors
CompositeKey()
Default constructor.
Declaration
public CompositeKey()
CompositeKey(object, object)
Create a new CompositeKey that consists of the given primary and secondary components.
Declaration
public CompositeKey(object primary, object secondary)
Parameters
| Type | Name | Description |
|---|---|---|
| object | primary | the primary key component; must not be null. This is also the host key returned by the KeyAssociation implementation |
| object | secondary | the secondary key component; must not be null |
Properties
AssociatedKey
Determine the key object to which this key object is associated.
Declaration
public object AssociatedKey { get; }
Property Value
| Type | Description |
|---|---|
| object | The host key that for this key object, or |
Remarks
The key object returned by this method is often referred to as a host key.
PrimaryKey
The primary key component.
Declaration
public object PrimaryKey { get; }
Property Value
| Type | Description |
|---|---|
| object |
SecondaryKey
The secondary key component.
Declaration
public object SecondaryKey { get; }
Property Value
| Type | Description |
|---|---|
| object |
Methods
Equals(object)
Compare this object with another object to determine equality.
Declaration
public override bool Equals(object o)
Parameters
| Type | Name | Description |
|---|---|---|
| object | o | The object to compare with current object. |
Returns
| Type | Description |
|---|---|
| bool | true if this object and the passed object are equivalent CompositeKey objects. |
Overrides
GetHashCode()
Determine a hash value for the CompositeKey object.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | An integer hash value for this CompositeKey object. |
Overrides
ReadExternal(IPofReader)
Restore the contents of a user type instance by reading its state using the specified IPofReader object.
Declaration
public void ReadExternal(IPofReader reader)
Parameters
| Type | Name | Description |
|---|---|---|
| IPofReader | reader | The IPofReader from which to read the object's state. |
Exceptions
| Type | Condition |
|---|---|
| IOException | If an I/O error occurs. |
ToString()
Return a human-readable description for this CompositeKey.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string description of the object. |
Overrides
WriteExternal(IPofWriter)
Save the contents of a POF user type instance by writing its state using the specified IPofWriter object.
Declaration
public void WriteExternal(IPofWriter writer)
Parameters
| Type | Name | Description |
|---|---|---|
| IPofWriter | writer | The IPofWriter to which to write the object's state. |
Exceptions
| Type | Condition |
|---|---|
| IOException | If an I/O error occurs. |