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

Side by Side Diff: pkg/analyzer_experimental/lib/src/generated/source.dart

Issue 23852002: java2dart improvements and new analyzer_experimental snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 // This code was auto-generated, is not intended to be edited, and is subject to 1 // This code was auto-generated, is not intended to be edited, and is subject to
2 // significant change. Please see the README file for more information. 2 // significant change. Please see the README file for more information.
3 library engine.source; 3 library engine.source;
4 import 'java_core.dart'; 4 import 'java_core.dart';
5 import 'sdk.dart' show DartSdk; 5 import 'sdk.dart' show DartSdk;
6 import 'engine.dart' show AnalysisContext; 6 import 'engine.dart' show AnalysisContext;
7 /** 7 /**
8 * Instances of the class `SourceFactory` resolve possibly relative URI's agains t an existing 8 * Instances of the class `SourceFactory` resolve possibly relative URI's agains t an existing
9 * [Source]. 9 * [Source].
10 * 10 *
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 * @param modificationTime the time at which the contents were last set 415 * @param modificationTime the time at which the contents were last set
416 */ 416 */
417 void accept2(String contents, int modificationTime); 417 void accept2(String contents, int modificationTime);
418 } 418 }
419 /** 419 /**
420 * The enumeration `SourceKind` defines the different kinds of sources that are known to the 420 * The enumeration `SourceKind` defines the different kinds of sources that are known to the
421 * analysis engine. 421 * analysis engine.
422 * 422 *
423 * @coverage dart.engine.source 423 * @coverage dart.engine.source
424 */ 424 */
425 class SourceKind implements Enum<SourceKind> { 425 class SourceKind extends Enum<SourceKind> {
426 426
427 /** 427 /**
428 * A source containing HTML. The HTML might or might not contain Dart scripts. 428 * A source containing HTML. The HTML might or might not contain Dart scripts.
429 */ 429 */
430 static final SourceKind HTML = new SourceKind('HTML', 0); 430 static final SourceKind HTML = new SourceKind('HTML', 0);
431 431
432 /** 432 /**
433 * A Dart compilation unit that is not a part of another library. Libraries mi ght or might not 433 * A Dart compilation unit that is not a part of another library. Libraries mi ght or might not
434 * contain any directives, including a library directive. 434 * contain any directives, including a library directive.
435 */ 435 */
436 static final SourceKind LIBRARY = new SourceKind('LIBRARY', 1); 436 static final SourceKind LIBRARY = new SourceKind('LIBRARY', 1);
437 437
438 /** 438 /**
439 * A Dart compilation unit that is part of another library. Parts contain a pa rt-of directive. 439 * A Dart compilation unit that is part of another library. Parts contain a pa rt-of directive.
440 */ 440 */
441 static final SourceKind PART = new SourceKind('PART', 2); 441 static final SourceKind PART = new SourceKind('PART', 2);
442 442
443 /** 443 /**
444 * An unknown kind of source. Used both when it is not possible to identify th e kind of a source 444 * An unknown kind of source. Used both when it is not possible to identify th e kind of a source
445 * and also when the kind of a source is not known without performing a comput ation and the client 445 * and also when the kind of a source is not known without performing a comput ation and the client
446 * does not want to spend the time to identify the kind. 446 * does not want to spend the time to identify the kind.
447 */ 447 */
448 static final SourceKind UNKNOWN = new SourceKind('UNKNOWN', 3); 448 static final SourceKind UNKNOWN = new SourceKind('UNKNOWN', 3);
449 static final List<SourceKind> values = [HTML, LIBRARY, PART, UNKNOWN]; 449 static final List<SourceKind> values = [HTML, LIBRARY, PART, UNKNOWN];
450 450 SourceKind(String name, int ordinal) : super(name, ordinal);
451 /// The name of this enum constant, as declared in the enum declaration.
452 final String name;
453
454 /// The position in the enum declaration.
455 final int ordinal;
456 SourceKind(this.name, this.ordinal);
457 int compareTo(SourceKind other) => ordinal - other.ordinal;
458 int get hashCode => ordinal;
459 String toString() => name;
460 } 451 }
461 /** 452 /**
462 * The enumeration `UriKind` defines the different kinds of URI's that are known to the 453 * The enumeration `UriKind` defines the different kinds of URI's that are known to the
463 * analysis engine. These are used to keep track of the kind of URI associated w ith a given source. 454 * analysis engine. These are used to keep track of the kind of URI associated w ith a given source.
464 * 455 *
465 * @coverage dart.engine.source 456 * @coverage dart.engine.source
466 */ 457 */
467 class UriKind implements Enum<UriKind> { 458 class UriKind extends Enum<UriKind> {
468 459
469 /** 460 /**
470 * A 'dart:' URI. 461 * A 'dart:' URI.
471 */ 462 */
472 static final UriKind DART_URI = new UriKind('DART_URI', 0, 0x64); 463 static final UriKind DART_URI = new UriKind('DART_URI', 0, 0x64);
473 464
474 /** 465 /**
475 * A 'file:' URI. 466 * A 'file:' URI.
476 */ 467 */
477 static final UriKind FILE_URI = new UriKind('FILE_URI', 1, 0x66); 468 static final UriKind FILE_URI = new UriKind('FILE_URI', 1, 0x66);
478 469
479 /** 470 /**
480 * A 'package:' URI. 471 * A 'package:' URI.
481 */ 472 */
482 static final UriKind PACKAGE_URI = new UriKind('PACKAGE_URI', 2, 0x70); 473 static final UriKind PACKAGE_URI = new UriKind('PACKAGE_URI', 2, 0x70);
483 static final List<UriKind> values = [DART_URI, FILE_URI, PACKAGE_URI]; 474 static final List<UriKind> values = [DART_URI, FILE_URI, PACKAGE_URI];
484 475
485 /// The name of this enum constant, as declared in the enum declaration.
486 final String name;
487
488 /// The position in the enum declaration.
489 final int ordinal;
490
491 /** 476 /**
492 * The single character encoding used to identify this kind of URI. 477 * The single character encoding used to identify this kind of URI.
493 */ 478 */
494 int _encoding = 0; 479 int _encoding = 0;
495 480
496 /** 481 /**
497 * Initialize a newly created URI kind to have the given encoding. 482 * Initialize a newly created URI kind to have the given encoding.
498 * 483 *
499 * @param encoding the single character encoding used to identify this kind of URI. 484 * @param encoding the single character encoding used to identify this kind of URI.
500 */ 485 */
501 UriKind(this.name, this.ordinal, int encoding) { 486 UriKind(String name, int ordinal, int encoding) : super(name, ordinal) {
502 this._encoding = encoding; 487 this._encoding = encoding;
503 } 488 }
504 489
505 /** 490 /**
506 * Return the URI kind represented by the given encoding, or `null` if there i s no kind with 491 * Return the URI kind represented by the given encoding, or `null` if there i s no kind with
507 * the given encoding. 492 * the given encoding.
508 * 493 *
509 * @param encoding the single character encoding used to identify the URI kind to be returned 494 * @param encoding the single character encoding used to identify the URI kind to be returned
510 * @return the URI kind represented by the given encoding 495 * @return the URI kind represented by the given encoding
511 */ 496 */
(...skipping 10 matching lines...) Expand all
522 } 507 }
523 return null; 508 return null;
524 } 509 }
525 510
526 /** 511 /**
527 * Return the single character encoding used to identify this kind of URI. 512 * Return the single character encoding used to identify this kind of URI.
528 * 513 *
529 * @return the single character encoding used to identify this kind of URI 514 * @return the single character encoding used to identify this kind of URI
530 */ 515 */
531 int get encoding => _encoding; 516 int get encoding => _encoding;
532 int compareTo(UriKind other) => ordinal - other.ordinal;
533 int get hashCode => ordinal;
534 String toString() => name;
535 } 517 }
536 /** 518 /**
537 * A source range defines an [Element]'s source coordinates relative to its [Sou rce]. 519 * A source range defines an [Element]'s source coordinates relative to its [Sou rce].
538 * 520 *
539 * @coverage dart.engine.utilities 521 * @coverage dart.engine.utilities
540 */ 522 */
541 class SourceRange { 523 class SourceRange {
542 524
543 /** 525 /**
544 * The 0-based index of the first character of the source code for this elemen t, relative to the 526 * The 0-based index of the first character of the source code for this elemen t, relative to the
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 if (contents == null) { 867 if (contents == null) {
886 _stampMap.remove(source); 868 _stampMap.remove(source);
887 return _contentMap.remove(source) != null; 869 return _contentMap.remove(source) != null;
888 } else { 870 } else {
889 _stampMap[source] = JavaSystem.currentTimeMillis(); 871 _stampMap[source] = JavaSystem.currentTimeMillis();
890 String originalContents = javaMapPut(_contentMap, source, contents); 872 String originalContents = javaMapPut(_contentMap, source, contents);
891 return contents != originalContents; 873 return contents != originalContents;
892 } 874 }
893 } 875 }
894 } 876 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698