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

Side by Side Diff: lib/core/duration.dart

Issue 10993059: Stop using the Hashable interface. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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
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 // Dart core library. 5 // Dart core library.
6 6
7 /** 7 /**
8 * A [Duration] represents a time span. A duration can be negative. 8 * A [Duration] represents a time span. A duration can be negative.
9 */ 9 */
10 class Duration implements Comparable, Hashable { 10 class Duration implements Comparable {
11 static const int MILLISECONDS_PER_SECOND = 1000; 11 static const int MILLISECONDS_PER_SECOND = 1000;
12 static const int SECONDS_PER_MINUTE = 60; 12 static const int SECONDS_PER_MINUTE = 60;
13 static const int MINUTES_PER_HOUR = 60; 13 static const int MINUTES_PER_HOUR = 60;
14 static const int HOURS_PER_DAY = 24; 14 static const int HOURS_PER_DAY = 24;
15 15
16 static const int MILLISECONDS_PER_MINUTE = 16 static const int MILLISECONDS_PER_MINUTE =
17 MILLISECONDS_PER_SECOND * SECONDS_PER_MINUTE; 17 MILLISECONDS_PER_SECOND * SECONDS_PER_MINUTE;
18 static const int MILLISECONDS_PER_HOUR = 18 static const int MILLISECONDS_PER_HOUR =
19 MILLISECONDS_PER_MINUTE * MINUTES_PER_HOUR; 19 MILLISECONDS_PER_MINUTE * MINUTES_PER_HOUR;
20 static const int MILLISECONDS_PER_DAY = 20 static const int MILLISECONDS_PER_DAY =
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 } 111 }
112 String twoDigitMinutes = 112 String twoDigitMinutes =
113 twoDigits(inMinutes.remainder(Duration.MINUTES_PER_HOUR)); 113 twoDigits(inMinutes.remainder(Duration.MINUTES_PER_HOUR));
114 String twoDigitSeconds = 114 String twoDigitSeconds =
115 twoDigits(inSeconds.remainder(Duration.SECONDS_PER_MINUTE)); 115 twoDigits(inSeconds.remainder(Duration.SECONDS_PER_MINUTE));
116 String threeDigitMs = 116 String threeDigitMs =
117 threeDigits(inMilliseconds.remainder(Duration.MILLISECONDS_PER_SECOND)); 117 threeDigits(inMilliseconds.remainder(Duration.MILLISECONDS_PER_SECOND));
118 return "$inHours:$twoDigitMinutes:$twoDigitSeconds.$threeDigitMs"; 118 return "$inHours:$twoDigitMinutes:$twoDigitSeconds.$threeDigitMs";
119 } 119 }
120 } 120 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698