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

Side by Side Diff: samples/swarm/swarm_ui_lib/base/Size.dart

Issue 11361190: a === b -> identical(a, b) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 /** 5 /**
6 * A utility class for representing two-dimensional sizes. 6 * A utility class for representing two-dimensional sizes.
7 */ 7 */
8 class Size { 8 class Size {
9 num width; 9 num width;
10 num height; 10 num height;
11 11
12 Size(num this.width, num this.height) { 12 Size(num this.width, num this.height) {
13 } 13 }
14 14
15 bool operator ==(Size other) { 15 bool operator ==(Size other) {
16 return other !== null && width == other.width && height == other.height; 16 return other != null && width == other.width && height == other.height;
17 } 17 }
18 18
19 /** 19 /**
20 * Returns the area of the size (width * height). 20 * Returns the area of the size (width * height).
21 */ 21 */
22 num area() { 22 num area() {
23 return width * height; 23 return width * height;
24 } 24 }
25 25
26 /** 26 /**
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 } 129 }
130 130
131 /** 131 /**
132 * Returns a nice string representing size. 132 * Returns a nice string representing size.
133 * Returns in the form (50 x 73). 133 * Returns in the form (50 x 73).
134 */ 134 */
135 String toString() { 135 String toString() {
136 return "(${width} x ${height})"; 136 return "(${width} x ${height})";
137 } 137 }
138 } 138 }
OLDNEW
« no previous file with comments | « samples/swarm/swarm_ui_lib/base/AnimationScheduler.dart ('k') | samples/swarm/swarm_ui_lib/observable/observable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698