antlr4ts
Version:
ANTLR 4 runtime for JavaScript written in Typescript
32 lines (31 loc) • 1.16 kB
TypeScript
/*!
* Copyright 2016 The ANTLR Project. All rights reserved.
* Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information.
*/
import { EqualityComparator } from "./EqualityComparator";
/**
* This default implementation of {@link EqualityComparator} uses object equality
* for comparisons by calling {@link Object#hashCode} and {@link Object#equals}.
*
* @author Sam Harwell
*/
export declare class DefaultEqualityComparator implements EqualityComparator<any> {
static readonly INSTANCE: DefaultEqualityComparator;
/**
* {@inheritDoc}
*
* This implementation returns
* `obj.`{@link Object#hashCode hashCode()}.
*/
hashCode(obj: any): number;
/**
* {@inheritDoc}
*
* This implementation relies on object equality. If both objects are
* `undefined` or `null`, this method returns `true`. Otherwise if only
* `a` is `undefined` or `null`, this method returns `false`. Otherwise,
* this method returns the result of
* `a.`{@link Object#equals equals}`(b)`.
*/
equals(a: any, b: any): boolean;
}