Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

equals.BasicObject

Compares an object with another


Description

Compares an object with another and returns TRUE if they are equal. The equal property must be

1) reflexive, i.e. equals(o1,o1) should be TRUE.

2) symmetric, i.e. equals(o1,o2) is TRUE if and only if equals(o2,o1) is TRUE.

3) transitive, i.e. equals(o1,o2) is TRUE and equals(o2,o3) is TRUE, then equals(o1,o3) should be TRUE.

5) consistent, i.e. equals(o1,o2) should return the same result on multiple invocations as long as noting has changed.

6) equals(o1,NULL) should return FALSE.

By default, the method returns TRUE if and only if the two references compared refer to the same BasicObject, i.e. ( !is.null(obj) && (hashCode(this) == hashCode(obj)) ).

Usage

## S3 method for class 'BasicObject'
equals(this, other, ...)

Arguments

other

The other object this object should be compared to.

...

Not used.

Value

Returns TRUE if the objects are equal, otherwise FALSE.

Author(s)

Henrik Bengtsson

See Also

For more information see BasicObject.


R.oo

R Object-Oriented Programming with or without References

v1.24.0
LGPL (>= 2.1)
Authors
Henrik Bengtsson [aut, cre, cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.