| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library analyzer.src.context.cache; | 5 library analyzer.src.context.cache; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 | 9 |
| 10 import 'package:analyzer/src/dart/element/element.dart' | 10 import 'package:analyzer/src/dart/element/element.dart' |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 * | 172 * |
| 173 * It does not update the cache, if the corresponding [CacheEntry] does not | 173 * It does not update the cache, if the corresponding [CacheEntry] does not |
| 174 * exist, then the default value is returned. | 174 * exist, then the default value is returned. |
| 175 */ | 175 */ |
| 176 Object/*=V*/ getValue/*<V>*/( | 176 Object/*=V*/ getValue/*<V>*/( |
| 177 AnalysisTarget target, ResultDescriptor/*<V>*/ result) { | 177 AnalysisTarget target, ResultDescriptor/*<V>*/ result) { |
| 178 CacheEntry entry = get(target); | 178 CacheEntry entry = get(target); |
| 179 if (entry == null) { | 179 if (entry == null) { |
| 180 return result.defaultValue; | 180 return result.defaultValue; |
| 181 } | 181 } |
| 182 return entry.getValue(result) as Object/*=V*/; | 182 return entry.getValue(result); |
| 183 } | 183 } |
| 184 | 184 |
| 185 /** | 185 /** |
| 186 * Return an iterator returning all of the map entries mapping targets to | 186 * Return an iterator returning all of the map entries mapping targets to |
| 187 * cache entries. If the [context] is not `null`, then only entries that are | 187 * cache entries. If the [context] is not `null`, then only entries that are |
| 188 * owned by the given context will be returned. | 188 * owned by the given context will be returned. |
| 189 */ | 189 */ |
| 190 MapIterator<AnalysisTarget, CacheEntry> iterator( | 190 MapIterator<AnalysisTarget, CacheEntry> iterator( |
| 191 {InternalAnalysisContext context: null}) { | 191 {InternalAnalysisContext context: null}) { |
| 192 List<Map<AnalysisTarget, CacheEntry>> maps = | 192 List<Map<AnalysisTarget, CacheEntry>> maps = |
| (...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1279 void resultAccessed(TargetedResult result) {} | 1279 void resultAccessed(TargetedResult result) {} |
| 1280 | 1280 |
| 1281 @override | 1281 @override |
| 1282 List<TargetedResult> resultStored(TargetedResult newResult, newValue) { | 1282 List<TargetedResult> resultStored(TargetedResult newResult, newValue) { |
| 1283 return TargetedResult.EMPTY_LIST; | 1283 return TargetedResult.EMPTY_LIST; |
| 1284 } | 1284 } |
| 1285 | 1285 |
| 1286 @override | 1286 @override |
| 1287 void targetRemoved(AnalysisTarget target) {} | 1287 void targetRemoved(AnalysisTarget target) {} |
| 1288 } | 1288 } |
| OLD | NEW |