#include <jem/util/ObjectPair.h>
jem::util::ObjectPair::ObjectPair |
( |
| ) |
|
jem::util::ObjectPair::ObjectPair |
( |
const Ref< Object > & |
first, |
|
|
const Ref< Object > & |
second |
|
) |
| |
virtual jem::util::ObjectPair::~ObjectPair |
( |
| ) |
|
|
protectedvirtual |
virtual lint jem::util::ObjectPair::hashValue |
( |
| ) |
const |
|
virtual |
Returns a hash value for this object. This function should return the same hash value when it is invoked more than once on the same object, provided that the object is not modified. If two object are equal according to the equals
method, then those objects should return the same hash value. Note that two objects which are not equal may also return the same hash value.
The hashValue
implementation of the Object
class returns a hash value for the memory address of the object.
- Returns
- A long integer representing the hash value of this object.
Reimplemented from jem::Object.
virtual bool jem::util::ObjectPair::equals |
( |
const Ref< Object > & |
obj | ) |
const |
|
virtual |
Tests whether this Object
is equal to the Object
obj. The equals
method should be:
- reflexive: for all objects
x
, x->equals(x)
should return true
.
- symmetric: for all objects
x
and y
, x->equals(y)
should return the same value as y->equals(x)
.
- transitive: if, for any objects
x
, y
, and z
, x->equals(y)
returns true
and y->equals(z)
returns true
, then x->equals(z)
should return true
.
- consistent: for all objects
x
and y
, multiple invocations of x->equals(y)
should return the same value as long as the objects are not modified.
In addition, x->equals(NIL)
should return false
for all objects x
.
The default implementation of equals
returns true
if and only if this object and the argument obj are located at the same memory address. That is, the default implementation returns (this == obj)
.
- Parameters
-
obj | - the object this object should be compared to, or NIL . |
- Returns
true
is this object equals the object obj, and false
otherwise.
Reimplemented from jem::Object.
virtual Ref<Object> jem::util::ObjectPair::clone |
( |
| ) |
const |
|
virtual |
virtual Ref<Object> jem::util::ObjectPair::getFirst |
( |
| ) |
const |
|
virtual |
virtual Ref<Object> jem::util::ObjectPair::getSecond |
( |
| ) |
const |
|
virtual |
virtual void jem::util::ObjectPair::setFirst |
( |
const Ref< Object > & |
obj | ) |
|
|
virtual |
virtual void jem::util::ObjectPair::setSecond |
( |
const Ref< Object > & |
obj | ) |
|
|
virtual |