Equals

The Equals aspect can be used in cross-platform code to mark the method that compares to object instance for equality.

Using this attribute makes it easier to implement this common method in cross-platform code, despite the fact that the different platforms expect slightly different naming conventions (Equals on .NET and Island, lower-case equals on Java and isEqual on Cocoa).

A single method on a class that takes an Object as parameter and returns a Boolean may be annotated with the aspect, and the compiler will automatically adjust it internally to implement the appropriate method for each platform.

[&Equals]
method NameDoesNotMatter(aOther: Object): Boolean;
begin
  ...
end;
[Equals]
public string NameDoesNotMatter(object aOther)
{
    ...
}
@Equals
public func NameDoesNotMatter(aOther: Object) -> Bool {
    ...
}
@Equals
public Boolean NameDoesNotMatter(Object aOther)
{
    ...
}

Defined in RemObjects.Elements.Cirrus.dll

See Also