| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine.source; | 8 library engine.source; |
| 9 | 9 |
| 10 import 'dart:collection'; | 10 import 'dart:collection'; |
| 11 import "dart:math" as math; |
| 12 |
| 11 import 'java_core.dart'; | 13 import 'java_core.dart'; |
| 12 import 'sdk.dart' show DartSdk; | 14 import 'sdk.dart' show DartSdk; |
| 13 import 'engine.dart'; | 15 import 'engine.dart'; |
| 14 import 'java_engine.dart'; | 16 import 'java_engine.dart'; |
| 15 | 17 |
| 16 /** | 18 /** |
| 17 * Instances of class `ContentCache` hold content used to override the default c
ontent of a | 19 * Instances of class `ContentCache` hold content used to override the default c
ontent of a |
| 18 * [Source]. | 20 * [Source]. |
| 19 */ | 21 */ |
| 20 class ContentCache { | 22 class ContentCache { |
| (...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 | 776 |
| 775 /** | 777 /** |
| 776 * @return the expanded translated of [SourceRange], with moved start and the
same length. | 778 * @return the expanded translated of [SourceRange], with moved start and the
same length. |
| 777 */ | 779 */ |
| 778 SourceRange getTranslated(int delta) => new SourceRange(offset + delta, length
); | 780 SourceRange getTranslated(int delta) => new SourceRange(offset + delta, length
); |
| 779 | 781 |
| 780 /** | 782 /** |
| 781 * @return the minimal [SourceRange] that cover this and the given [SourceRang
e]s. | 783 * @return the minimal [SourceRange] that cover this and the given [SourceRang
e]s. |
| 782 */ | 784 */ |
| 783 SourceRange getUnion(SourceRange other) { | 785 SourceRange getUnion(SourceRange other) { |
| 784 int newOffset = Math.min(offset, other.offset); | 786 int newOffset = math.min(offset, other.offset); |
| 785 int newEnd = Math.max(offset + length, other.offset + other.length); | 787 int newEnd = math.max(offset + length, other.offset + other.length); |
| 786 return new SourceRange(newOffset, newEnd - newOffset); | 788 return new SourceRange(newOffset, newEnd - newOffset); |
| 787 } | 789 } |
| 788 | 790 |
| 789 @override | 791 @override |
| 790 int get hashCode => 31 * offset + length; | 792 int get hashCode => 31 * offset + length; |
| 791 | 793 |
| 792 /** | 794 /** |
| 793 * @return `true` if this [SourceRange] intersects with given. | 795 * @return `true` if this [SourceRange] intersects with given. |
| 794 */ | 796 */ |
| 795 bool intersects(SourceRange other) { | 797 bool intersects(SourceRange other) { |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 902 | 904 |
| 903 /** | 905 /** |
| 904 * Return an absolute URI that represents the given source, or `null` if a val
id URI cannot | 906 * Return an absolute URI that represents the given source, or `null` if a val
id URI cannot |
| 905 * be computed. | 907 * be computed. |
| 906 * | 908 * |
| 907 * @param source the source to get URI for | 909 * @param source the source to get URI for |
| 908 * @return the absolute URI representing the given source | 910 * @return the absolute URI representing the given source |
| 909 */ | 911 */ |
| 910 Uri restoreAbsolute(Source source) => null; | 912 Uri restoreAbsolute(Source source) => null; |
| 911 } | 913 } |
| OLD | NEW |