| 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'; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 * A table mapping sources to the modification stamps of those sources. This i
s used when the | 30 * A table mapping sources to the modification stamps of those sources. This i
s used when the |
| 31 * default contents of a source has been overridden. | 31 * default contents of a source has been overridden. |
| 32 */ | 32 */ |
| 33 HashMap<Source, int> _stampMap = new HashMap<Source, int>(); | 33 HashMap<Source, int> _stampMap = new HashMap<Source, int>(); |
| 34 | 34 |
| 35 /** | 35 /** |
| 36 * Return the contents of the given source, or `null` if this cache does not o
verride the | 36 * Return the contents of the given source, or `null` if this cache does not o
verride the |
| 37 * contents of the source. | 37 * contents of the source. |
| 38 * | 38 * |
| 39 * <b>Note:</b> This method is not intended to be used except by | 39 * <b>Note:</b> This method is not intended to be used except by |
| 40 * [AnalysisContext#getContents]. | 40 * [AnalysisContext.getContents]. |
| 41 * | 41 * |
| 42 * @param source the source whose content is to be returned | 42 * @param source the source whose content is to be returned |
| 43 * @return the contents of the given source | 43 * @return the contents of the given source |
| 44 */ | 44 */ |
| 45 String getContents(Source source) => _contentMap[source]; | 45 String getContents(Source source) => _contentMap[source]; |
| 46 | 46 |
| 47 /** | 47 /** |
| 48 * Return the modification stamp of the given source, or `null` if this cache
does not | 48 * Return the modification stamp of the given source, or `null` if this cache
does not |
| 49 * override the contents of the source. | 49 * override the contents of the source. |
| 50 * | 50 * |
| 51 * <b>Note:</b> This method is not intended to be used except by | 51 * <b>Note:</b> This method is not intended to be used except by |
| 52 * [AnalysisContext#getModificationStamp]. | 52 * [AnalysisContext.getModificationStamp]. |
| 53 * | 53 * |
| 54 * @param source the source whose modification stamp is to be returned | 54 * @param source the source whose modification stamp is to be returned |
| 55 * @return the modification stamp of the given source | 55 * @return the modification stamp of the given source |
| 56 */ | 56 */ |
| 57 int getModificationStamp(Source source) => _stampMap[source]; | 57 int getModificationStamp(Source source) => _stampMap[source]; |
| 58 | 58 |
| 59 /** | 59 /** |
| 60 * Set the contents of the given source to the given contents. This has the ef
fect of overriding | 60 * Set the contents of the given source to the given contents. This has the ef
fect of overriding |
| 61 * the default contents of the source. If the contents are `null` the override
is removed so | 61 * the default contents of the source. If the contents are `null` the override
is removed so |
| 62 * that the default contents will be returned. | 62 * that the default contents will be returned. |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 */ | 368 */ |
| 369 static final List<Source> EMPTY_ARRAY = new List<Source>(0); | 369 static final List<Source> EMPTY_ARRAY = new List<Source>(0); |
| 370 | 370 |
| 371 /** | 371 /** |
| 372 * Return `true` if the given object is a source that represents the same sour
ce code as | 372 * Return `true` if the given object is a source that represents the same sour
ce code as |
| 373 * this source. | 373 * this source. |
| 374 * | 374 * |
| 375 * @param object the object to be compared with this object | 375 * @param object the object to be compared with this object |
| 376 * @return `true` if the given object is a source that represents the same sou
rce code as | 376 * @return `true` if the given object is a source that represents the same sou
rce code as |
| 377 * this source | 377 * this source |
| 378 * @see Object#equals(Object) | 378 * See [Object.==]. |
| 379 */ | 379 */ |
| 380 @override | 380 @override |
| 381 bool operator ==(Object object); | 381 bool operator ==(Object object); |
| 382 | 382 |
| 383 /** | 383 /** |
| 384 * Return `true` if this source exists. | 384 * Return `true` if this source exists. |
| 385 * | 385 * |
| 386 * Clients should consider using the the method [AnalysisContext#exists] becau
se | 386 * Clients should consider using the the method [AnalysisContext.exists] becau
se |
| 387 * contexts can have local overrides of the content of a source that the sourc
e is not aware of | 387 * contexts can have local overrides of the content of a source that the sourc
e is not aware of |
| 388 * and a source with local content is considered to exist even if there is no
file on disk. | 388 * and a source with local content is considered to exist even if there is no
file on disk. |
| 389 * | 389 * |
| 390 * @return `true` if this source exists | 390 * @return `true` if this source exists |
| 391 */ | 391 */ |
| 392 bool exists(); | 392 bool exists(); |
| 393 | 393 |
| 394 /** | 394 /** |
| 395 * Get the contents and timestamp of this source. | 395 * Get the contents and timestamp of this source. |
| 396 * | 396 * |
| 397 * Clients should consider using the the method [AnalysisContext#getContents] | 397 * Clients should consider using the the method [AnalysisContext.getContents] |
| 398 * because contexts can have local overrides of the content of a source that t
he source is not | 398 * because contexts can have local overrides of the content of a source that t
he source is not |
| 399 * aware of. | 399 * aware of. |
| 400 * | 400 * |
| 401 * @return the contents and timestamp of the source | 401 * @return the contents and timestamp of the source |
| 402 * @throws Exception if the contents of this source could not be accessed | 402 * @throws Exception if the contents of this source could not be accessed |
| 403 */ | 403 */ |
| 404 TimestampedData<String> get contents; | 404 TimestampedData<String> get contents; |
| 405 | 405 |
| 406 /** | 406 /** |
| 407 * Return an encoded representation of this source that can be used to create
a source that is | 407 * Return an encoded representation of this source that can be used to create
a source that is |
| 408 * equal to this source. | 408 * equal to this source. |
| 409 * | 409 * |
| 410 * @return an encoded representation of this source | 410 * @return an encoded representation of this source |
| 411 * @see SourceFactory#fromEncoding(String) | 411 * See [SourceFactory.fromEncoding]. |
| 412 */ | 412 */ |
| 413 String get encoding; | 413 String get encoding; |
| 414 | 414 |
| 415 /** | 415 /** |
| 416 * Return the full (long) version of the name that can be displayed to the use
r to denote this | 416 * Return the full (long) version of the name that can be displayed to the use
r to denote this |
| 417 * source. For example, for a source representing a file this would typically
be the absolute path | 417 * source. For example, for a source representing a file this would typically
be the absolute path |
| 418 * of the file. | 418 * of the file. |
| 419 * | 419 * |
| 420 * @return a name that can be displayed to the user to denote this source | 420 * @return a name that can be displayed to the user to denote this source |
| 421 */ | 421 */ |
| 422 String get fullName; | 422 String get fullName; |
| 423 | 423 |
| 424 /** | 424 /** |
| 425 * Return the modification stamp for this source. A modification stamp is a no
n-negative integer | 425 * Return the modification stamp for this source. A modification stamp is a no
n-negative integer |
| 426 * with the property that if the contents of the source have not been modified
since the last time | 426 * with the property that if the contents of the source have not been modified
since the last time |
| 427 * the modification stamp was accessed then the same value will be returned, b
ut if the contents | 427 * the modification stamp was accessed then the same value will be returned, b
ut if the contents |
| 428 * of the source have been modified one or more times (even if the net change
is zero) the stamps | 428 * of the source have been modified one or more times (even if the net change
is zero) the stamps |
| 429 * will be different. | 429 * will be different. |
| 430 * | 430 * |
| 431 * Clients should consider using the the method | 431 * Clients should consider using the the method |
| 432 * [AnalysisContext#getModificationStamp] because contexts can have local over
rides | 432 * [AnalysisContext.getModificationStamp] because contexts can have local over
rides |
| 433 * of the content of a source that the source is not aware of. | 433 * of the content of a source that the source is not aware of. |
| 434 * | 434 * |
| 435 * @return the modification stamp for this source | 435 * @return the modification stamp for this source |
| 436 */ | 436 */ |
| 437 int get modificationStamp; | 437 int get modificationStamp; |
| 438 | 438 |
| 439 /** | 439 /** |
| 440 * Return a short version of the name that can be displayed to the user to den
ote this source. For | 440 * Return a short version of the name that can be displayed to the user to den
ote this source. For |
| 441 * example, for a source representing a file this would typically be the name
of the file. | 441 * example, for a source representing a file this would typically be the name
of the file. |
| 442 * | 442 * |
| (...skipping 15 matching lines...) Expand all Loading... |
| 458 * of the source against which the relative URI was resolved. | 458 * of the source against which the relative URI was resolved. |
| 459 * | 459 * |
| 460 * @return the kind of URI from which this source was originally derived | 460 * @return the kind of URI from which this source was originally derived |
| 461 */ | 461 */ |
| 462 UriKind get uriKind; | 462 UriKind get uriKind; |
| 463 | 463 |
| 464 /** | 464 /** |
| 465 * Return a hash code for this source. | 465 * Return a hash code for this source. |
| 466 * | 466 * |
| 467 * @return a hash code for this source | 467 * @return a hash code for this source |
| 468 * @see Object#hashCode() | 468 * See [Object.hashCode]. |
| 469 */ | 469 */ |
| 470 @override | 470 @override |
| 471 int get hashCode; | 471 int get hashCode; |
| 472 | 472 |
| 473 /** | 473 /** |
| 474 * Return `true` if this source is in one of the system libraries. | 474 * Return `true` if this source is in one of the system libraries. |
| 475 * | 475 * |
| 476 * @return `true` if this is in a system library | 476 * @return `true` if this is in a system library |
| 477 */ | 477 */ |
| 478 bool get isInSystemLibrary; | 478 bool get isInSystemLibrary; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 } | 578 } |
| 579 return null; | 579 return null; |
| 580 } | 580 } |
| 581 | 581 |
| 582 /** | 582 /** |
| 583 * Return a source object that is equal to the source object used to obtain th
e given encoding. | 583 * Return a source object that is equal to the source object used to obtain th
e given encoding. |
| 584 * | 584 * |
| 585 * @param encoding the encoding of a source object | 585 * @param encoding the encoding of a source object |
| 586 * @return a source object that is described by the given encoding | 586 * @return a source object that is described by the given encoding |
| 587 * @throws IllegalArgumentException if the argument is not a valid encoding | 587 * @throws IllegalArgumentException if the argument is not a valid encoding |
| 588 * @see Source#getEncoding() | 588 * See [Source.encoding]. |
| 589 */ | 589 */ |
| 590 Source fromEncoding(String encoding) { | 590 Source fromEncoding(String encoding) { |
| 591 Source source = forUri(encoding); | 591 Source source = forUri(encoding); |
| 592 if (source == null) { | 592 if (source == null) { |
| 593 throw new IllegalArgumentException("Invalid source encoding: $encoding"); | 593 throw new IllegalArgumentException("Invalid source encoding: $encoding"); |
| 594 } | 594 } |
| 595 return source; | 595 return source; |
| 596 } | 596 } |
| 597 | 597 |
| 598 /** | 598 /** |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 946 | 946 |
| 947 /** | 947 /** |
| 948 * Return an absolute URI that represents the given source, or `null` if a val
id URI cannot | 948 * Return an absolute URI that represents the given source, or `null` if a val
id URI cannot |
| 949 * be computed. | 949 * be computed. |
| 950 * | 950 * |
| 951 * @param source the source to get URI for | 951 * @param source the source to get URI for |
| 952 * @return the absolute URI representing the given source | 952 * @return the absolute URI representing the given source |
| 953 */ | 953 */ |
| 954 Uri restoreAbsolute(Source source) => null; | 954 Uri restoreAbsolute(Source source) => null; |
| 955 } | 955 } |
| OLD | NEW |