| OLD | NEW |
| 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 |
| 3 library engine.utilities.collection; | 4 library engine.utilities.collection; |
| 5 |
| 4 import 'java_core.dart'; | 6 import 'java_core.dart'; |
| 5 import 'scanner.dart' show Token; | 7 import 'scanner.dart' show Token; |
| 8 |
| 6 /** | 9 /** |
| 7 * The class `BooleanArray` defines methods for operating on integers as if they
were arrays | 10 * The class `BooleanArray` defines methods for operating on integers as if they
were arrays |
| 8 * of booleans. These arrays can be indexed by either integers or by enumeration
constants. | 11 * of booleans. These arrays can be indexed by either integers or by enumeration
constants. |
| 9 */ | 12 */ |
| 10 class BooleanArray { | 13 class BooleanArray { |
| 11 | |
| 12 /** | 14 /** |
| 13 * Return the value of the element at the given index. | 15 * Return the value of the element at the given index. |
| 14 * | 16 * |
| 15 * @param array the array being accessed | 17 * @param array the array being accessed |
| 16 * @param index the index of the element being accessed | 18 * @param index the index of the element being accessed |
| 17 * @return the value of the element at the given index | 19 * @return the value of the element at the given index |
| 18 * @throws IndexOutOfBoundsException if the index is not between zero (0) and
31, inclusive | 20 * @throws IndexOutOfBoundsException if the index is not between zero (0) and
31, inclusive |
| 19 */ | 21 */ |
| 20 static bool get(int array, Enum index) => get2(array, index.ordinal); | 22 static bool get(int array, Enum index) => get2(array, index.ordinal); |
| 21 | 23 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 * of boolean values. | 68 * of boolean values. |
| 67 * | 69 * |
| 68 * @throws IndexOutOfBoundsException if the index is not between zero (0) and
31, inclusive | 70 * @throws IndexOutOfBoundsException if the index is not between zero (0) and
31, inclusive |
| 69 */ | 71 */ |
| 70 static void checkIndex(int index) { | 72 static void checkIndex(int index) { |
| 71 if (index < 0 || index > 30) { | 73 if (index < 0 || index > 30) { |
| 72 throw new RangeError("Index not between 0 and 30: ${index}"); | 74 throw new RangeError("Index not between 0 and 30: ${index}"); |
| 73 } | 75 } |
| 74 } | 76 } |
| 75 } | 77 } |
| 78 |
| 76 /** | 79 /** |
| 77 * Instances of the class `TokenMap` map one set of tokens to another set of tok
ens. | 80 * Instances of the class `TokenMap` map one set of tokens to another set of tok
ens. |
| 78 */ | 81 */ |
| 79 class TokenMap { | 82 class TokenMap { |
| 80 | |
| 81 /** | 83 /** |
| 82 * A table mapping tokens to tokens. This should be replaced by a more perform
ant implementation. | 84 * A table mapping tokens to tokens. This should be replaced by a more perform
ant implementation. |
| 83 * One possibility is a pair of parallel arrays, with keys being sorted by the
ir offset and a | 85 * One possibility is a pair of parallel arrays, with keys being sorted by the
ir offset and a |
| 84 * cursor indicating where to start searching. | 86 * cursor indicating where to start searching. |
| 85 */ | 87 */ |
| 86 Map<Token, Token> _map = new Map<Token, Token>(); | 88 Map<Token, Token> _map = new Map<Token, Token>(); |
| 87 | 89 |
| 88 /** | 90 /** |
| 89 * Return the token that is mapped to the given token, or `null` if there is n
o token | 91 * Return the token that is mapped to the given token, or `null` if there is n
o token |
| 90 * corresponding to the given token. | 92 * corresponding to the given token. |
| 91 * | 93 * |
| 92 * @param key the token being mapped to another token | 94 * @param key the token being mapped to another token |
| 93 * @return the token that is mapped to the given token | 95 * @return the token that is mapped to the given token |
| 94 */ | 96 */ |
| 95 Token get(Token key) => _map[key]; | 97 Token get(Token key) => _map[key]; |
| 96 | 98 |
| 97 /** | 99 /** |
| 98 * Map the key to the value. | 100 * Map the key to the value. |
| 99 * | 101 * |
| 100 * @param key the token being mapped to the value | 102 * @param key the token being mapped to the value |
| 101 * @param value the token to which the key will be mapped | 103 * @param value the token to which the key will be mapped |
| 102 */ | 104 */ |
| 103 void put(Token key, Token value) { | 105 void put(Token key, Token value) { |
| 104 _map[key] = value; | 106 _map[key] = value; |
| 105 } | 107 } |
| 106 } | 108 } |
| 109 |
| 107 /** | 110 /** |
| 108 * The class `ListUtilities` defines utility methods useful for working with [Li
st | 111 * The class `ListUtilities` defines utility methods useful for working with [Li
st |
| 109 ]. | 112 ]. |
| 110 */ | 113 */ |
| 111 class ListUtilities { | 114 class ListUtilities { |
| 112 | |
| 113 /** | 115 /** |
| 114 * Add all of the elements in the given array to the given list. | 116 * Add all of the elements in the given array to the given list. |
| 115 * | 117 * |
| 116 * @param list the list to which the elements are to be added | 118 * @param list the list to which the elements are to be added |
| 117 * @param elements the elements to be added to the list | 119 * @param elements the elements to be added to the list |
| 118 */ | 120 */ |
| 119 static void addAll(List list, List<Object> elements) { | 121 static void addAll(List list, List<Object> elements) { |
| 120 for (Object element in elements) { | 122 for (Object element in elements) { |
| 121 list.add(element); | 123 list.add(element); |
| 122 } | 124 } |
| 123 } | 125 } |
| 124 } | 126 } |
| OLD | NEW |