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

Side by Side Diff: samples/ui_lib/touch/Geometry.dart

Issue 10919146: Get rid of a lot of () for getters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « samples/ui_lib/observable/observable.dart ('k') | samples/ui_lib/touch/Momentum.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) 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 * Represents a point in 2 dimensional space. 6 * Represents a point in 2 dimensional space.
7 */ 7 */
8 class Coordinate { 8 class Coordinate {
9 9
10 /** 10 /**
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 /** 61 /**
62 * Represents the interval { x | start <= x < end }. 62 * Represents the interval { x | start <= x < end }.
63 */ 63 */
64 class Interval { 64 class Interval {
65 65
66 final num start; 66 final num start;
67 final num end; 67 final num end;
68 68
69 Interval(num this.start, num this.end) {} 69 Interval(num this.start, num this.end) {}
70 70
71 num get length() { 71 num get length {
72 return end - start; 72 return end - start;
73 } 73 }
74 74
75 bool operator ==(Interval other) { 75 bool operator ==(Interval other) {
76 return other !== null && other.start == start && other.end == end; 76 return other !== null && other.start == start && other.end == end;
77 } 77 }
78 78
79 Interval union(Interval other) { 79 Interval union(Interval other) {
80 return new Interval(Math.min(start, other.start), 80 return new Interval(Math.min(start, other.start),
81 Math.max(end, other.end)); 81 Math.max(end, other.end));
82 } 82 }
83 83
84 bool contains(num value) { 84 bool contains(num value) {
85 return value >= start && value < end; 85 return value >= start && value < end;
86 } 86 }
87 87
88 String toString() { 88 String toString() {
89 return '(${start}, ${end})'; 89 return '(${start}, ${end})';
90 } 90 }
91 } 91 }
OLDNEW
« no previous file with comments | « samples/ui_lib/observable/observable.dart ('k') | samples/ui_lib/touch/Momentum.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698