| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 barback.asset_set; | 5 library barback.asset_set; |
| 6 | 6 |
| 7 import 'dart:async'; | |
| 8 import 'dart:collection'; | 7 import 'dart:collection'; |
| 9 import 'dart:io'; | |
| 10 | 8 |
| 11 import 'asset.dart'; | 9 import 'asset.dart'; |
| 12 import 'asset_id.dart'; | 10 import 'asset_id.dart'; |
| 13 | 11 |
| 14 /// A set of [Asset]s with distinct IDs. | 12 /// A set of [Asset]s with distinct IDs. |
| 15 /// | 13 /// |
| 16 /// This uses the [AssetId] of each asset to determine uniqueness, so no two | 14 /// This uses the [AssetId] of each asset to determine uniqueness, so no two |
| 17 /// assets with the same ID can be in the set. | 15 /// assets with the same ID can be in the set. |
| 18 class AssetSet extends IterableBase<Asset> { | 16 class AssetSet extends IterableBase<Asset> { |
| 19 final _assets = new Map<AssetId, Asset>(); | 17 final _assets = new Map<AssetId, Asset>(); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 } | 62 } |
| 65 | 63 |
| 66 /// If the set contains an [Asset] with [id], removes and returns it. | 64 /// If the set contains an [Asset] with [id], removes and returns it. |
| 67 Asset removeId(AssetId id) => _assets.remove(id); | 65 Asset removeId(AssetId id) => _assets.remove(id); |
| 68 | 66 |
| 69 /// Removes all assets from the set. | 67 /// Removes all assets from the set. |
| 70 void clear() { | 68 void clear() { |
| 71 _assets.clear(); | 69 _assets.clear(); |
| 72 } | 70 } |
| 73 } | 71 } |
| OLD | NEW |