OLD | NEW |
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 fixnum; | 5 part of fixnum; |
6 | 6 |
7 /** | 7 /** |
8 * A fixed-precision integer. | 8 * A fixed-precision integer. |
9 */ | 9 */ |
10 abstract class IntX implements Comparable { | 10 abstract class IntX implements Comparable<IntX> { |
11 | 11 |
12 /** Addition operator. */ | 12 /** Addition operator. */ |
13 IntX operator +(other); | 13 IntX operator +(other); |
14 | 14 |
15 /** Subtraction operator. */ | 15 /** Subtraction operator. */ |
16 IntX operator -(other); | 16 IntX operator -(other); |
17 | 17 |
18 /** | 18 /** |
19 * Negate operator. | 19 * Negate operator. |
20 * | 20 * |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 IntX operator >>(int shiftAmount); | 73 IntX operator >>(int shiftAmount); |
74 | 74 |
75 /** | 75 /** |
76 * Unsigned right-shift operator. | 76 * Unsigned right-shift operator. |
77 * | 77 * |
78 * Returns the result of shifting the bits of this integer by [shiftAmount] | 78 * Returns the result of shifting the bits of this integer by [shiftAmount] |
79 * bits to the right. High-order bits are filled with zeros. | 79 * bits to the right. High-order bits are filled with zeros. |
80 */ | 80 */ |
81 IntX shiftRightUnsigned(int shiftAmount); | 81 IntX shiftRightUnsigned(int shiftAmount); |
82 | 82 |
83 int compareTo(Comparable other); | |
84 | |
85 /** | 83 /** |
86 * Returns `true` if and only if [other] is an int or IntX equal in | 84 * Returns `true` if and only if [other] is an int or IntX equal in |
87 * value to this integer. | 85 * value to this integer. |
88 */ | 86 */ |
89 bool operator ==(other); | 87 bool operator ==(other); |
90 | 88 |
91 /** Relational less than operator. */ | 89 /** Relational less than operator. */ |
92 bool operator <(other); | 90 bool operator <(other); |
93 | 91 |
94 /** Relational less than or equal to operator. */ | 92 /** Relational less than or equal to operator. */ |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 */ | 226 */ |
229 String toHexString(); | 227 String toHexString(); |
230 | 228 |
231 /** | 229 /** |
232 * Returns a string representing the value of this integer in the given radix. | 230 * Returns a string representing the value of this integer in the given radix. |
233 * | 231 * |
234 * [radix] must be an integer in the range 2 .. 16, inclusive. | 232 * [radix] must be an integer in the range 2 .. 16, inclusive. |
235 */ | 233 */ |
236 String toRadixString(int radix); | 234 String toRadixString(int radix); |
237 } | 235 } |
OLD | NEW |