Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | |
| 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. | |
| 4 | |
| 5 /** | |
| 6 * A pair of values. | |
| 7 */ | |
| 8 class Pair<E, F> { | |
| 9 final E first; | |
| 10 final F last; | |
| 11 | |
| 12 Pair(this.first, this.last); | |
| 13 | |
| 14 @override | |
| 15 int get hashCode => first.hashCode ^ last.hashCode; | |
| 16 | |
| 17 @override | |
| 18 bool operator ==(other) { | |
| 19 if (other is! Pair) { | |
| 20 return false; | |
| 21 } | |
| 22 return other.first == first && other.last == last; | |
| 23 } | |
| 24 | |
| 25 @override | |
| 26 String toString() => '($first, $last)'; | |
| 27 } | |
| OLD | NEW |