Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Side by Side Diff: sdk/lib/core/object.dart

Issue 2856123003: Fix some bad documentation links. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sdk/lib/core/num.dart ('k') | sdk/lib/core/stopwatch.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart.core; 5 part of dart.core;
6 6
7 /** 7 /**
8 * The base class for all Dart objects. 8 * The base class for all Dart objects.
9 * 9 *
10 * Because Object is the root of the Dart class hierarchy, 10 * Because Object is the root of the Dart class hierarchy,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 * or return `null`. 42 * or return `null`.
43 * 43 *
44 * * Reflexive: For all objects `o`, `o == o` must be true. 44 * * Reflexive: For all objects `o`, `o == o` must be true.
45 * 45 *
46 * * Symmetric: For all objects `o1` and `o2`, `o1 == o2` and `o2 == o1` must 46 * * Symmetric: For all objects `o1` and `o2`, `o1 == o2` and `o2 == o1` must
47 * either both be true, or both be false. 47 * either both be true, or both be false.
48 * 48 *
49 * * Transitive: For all objects `o1`, `o2`, and `o3`, if `o1 == o2` and 49 * * Transitive: For all objects `o1`, `o2`, and `o3`, if `o1 == o2` and
50 * `o2 == o3` are true, then `o1 == o3` must be true. 50 * `o2 == o3` are true, then `o1 == o3` must be true.
51 * 51 *
52 * The method should also be consistent over time, 52 * The method should also be consistent over time,
53 * so whether two objects are equal should only change 53 * so whether two objects are equal should only change
54 * if at least one of the objects was modified. 54 * if at least one of the objects was modified.
55 * 55 *
56 * If a subclass overrides the equality operator it should override 56 * If a subclass overrides the equality operator it should override
57 * the [hashCode] method as well to maintain consistency. 57 * the [hashCode] method as well to maintain consistency.
58 */ 58 */
59 external bool operator ==(other); 59 external bool operator ==(other);
60 60
61 /** 61 /**
62 * The hash code for this object. 62 * The hash code for this object.
63 * 63 *
64 * A hash code is a single integer which represents the state of the object 64 * A hash code is a single integer which represents the state of the object
65 * that affects [==] comparisons. 65 * that affects [==] comparisons.
66 * 66 *
67 * All objects have hash codes. 67 * All objects have hash codes.
68 * The default hash code represents only the identity of the object, 68 * The default hash code represents only the identity of the object,
69 * the same way as the default [==] implementation only considers objects 69 * the same way as the default [==] implementation only considers objects
70 * equal if they are identical (see [identityHashCode]). 70 * equal if they are identical (see [identityHashCode]).
71 * 71 *
72 * If [==] is overridden to use the object state instead, 72 * If [==] is overridden to use the object state instead,
73 * the hash code must also be changed to represent that state. 73 * the hash code must also be changed to represent that state.
74 * 74 *
75 * Hash codes must be the same for objects that are equal to each other 75 * Hash codes must be the same for objects that are equal to each other
76 * according to [==]. 76 * according to [==].
77 * The hash code of an object should only change if the object changes 77 * The hash code of an object should only change if the object changes
78 * in a way that affects equality. 78 * in a way that affects equality.
79 * There are no further requirements for the hash codes. 79 * There are no further requirements for the hash codes.
80 * They need not be consistent between executions of the same program 80 * They need not be consistent between executions of the same program
81 * and there are no distribution guarantees. 81 * and there are no distribution guarantees.
82 * 82 *
83 * Objects that are not equal are allowed to have the same hash code, 83 * Objects that are not equal are allowed to have the same hash code,
84 * it is even technically allowed that all instances have the same hash code, 84 * it is even technically allowed that all instances have the same hash code,
85 * but if clashes happen too often, it may reduce the efficiency of hash-based 85 * but if clashes happen too often, it may reduce the efficiency of hash-based
86 * data structures like [HashSet] or [HashMap]. 86 * data structures like [HashSet] or [HashMap].
87 * 87 *
88 * If a subclass overrides [hashCode], it should override the 88 * If a subclass overrides [hashCode], it should override the
89 * [==] operator as well to maintain consistency. 89 * [==] operator as well to maintain consistency.
90 */ 90 */
91 external int get hashCode; 91 external int get hashCode;
92 92
93 /** 93 /**
94 * Returns a string representation of this object. 94 * Returns a string representation of this object.
95 */ 95 */
96 external String toString(); 96 external String toString();
97 97
98 /** 98 /**
99 * Invoked when a non-existent method or property is accessed. 99 * Invoked when a non-existent method or property is accessed.
100 * 100 *
101 * Classes can override [noSuchMethod] to provide custom behavior. 101 * Classes can override [noSuchMethod] to provide custom behavior.
102 * 102 *
103 * If a value is returned, it becomes the result of the original invocation. 103 * If a value is returned, it becomes the result of the original invocation.
104 * 104 *
105 * The default behavior is to throw a [NoSuchMethodError]. 105 * The default behavior is to throw a [NoSuchMethodError].
106 */ 106 */
107 external dynamic noSuchMethod(Invocation invocation); 107 external dynamic noSuchMethod(Invocation invocation);
108 108
109 /** 109 /**
110 * A representation of the runtime type of the object. 110 * A representation of the runtime type of the object.
111 */ 111 */
112 external Type get runtimeType; 112 external Type get runtimeType;
113 } 113 }
OLDNEW
« no previous file with comments | « sdk/lib/core/num.dart ('k') | sdk/lib/core/stopwatch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698