You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: definitions/src/Collectable.d.ts
+21-6Lines changed: 21 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,35 @@
1
1
/**
2
2
* @license
3
-
* Copyright Larry Diamond 2017 All Rights Reserved.
3
+
* Copyright Larry Diamond 2018 All Rights Reserved.
4
4
*
5
5
* Use of this source code is governed by an MIT-style license that can be
6
6
* found in the LICENSE file at https://github.com/larrydiamond/typescriptcollectionsframework/LICENSE
7
7
*/
8
+
/**
9
+
* The Collectable interface provides a mechanism to compare objects to see if they are equal.
10
+
* This is a replacement for the equals method in Java
11
+
*/
8
12
exportinterfaceCollectable<T>{
9
13
/**
10
14
* Compares its two arguments for equality
15
+
*
11
16
* The equals method implements an equivalence relation on non-null object references:
12
-
* It is reflexive: for any non-null reference value x, x.equals(x) should return true.
13
-
* It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
14
-
* It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
15
-
* It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
17
+
*
18
+
* It is reflexive: for any reference value x, x.equals(x) should return true.
19
+
*
20
+
* It is symmetric: for any reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
21
+
*
22
+
* It is transitive: for any reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
23
+
*
24
+
* It is consistent: for any reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
25
+
*
16
26
* For any non-null reference value x, x.equals(null) should return false.
17
-
* The equals method implements the most discriminating possible equivalence relation on objects; that is, for any non-null reference values x and y, this method returns true if and only if x and y refer to the same object (x == y has the value true).
27
+
*
28
+
* For any non-undefined reference value x, x.equals(undefined) should return false.
29
+
*
30
+
* The equals method implements the most discriminating possible equivalence relation on objects;
31
+
* that is, for any non-null and non-undefined reference values x and y,
32
+
* this method returns true if and only if x and y refer to the same object (x == y has the value true).
18
33
* @param {T} t element to compare
19
34
* @return {boolean} true if the other element is "equal" to this one
0 commit comments