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

Side by Side Diff: packages/collection/lib/src/empty_unmodifiable_set.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 4 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
« no previous file with comments | « packages/collection/lib/src/comparators.dart ('k') | packages/collection/lib/src/equality.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
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.
4
5 import 'dart:collection';
6
7 import 'unmodifiable_wrappers.dart';
8
9 // Unfortunately, we can't use UnmodifiableSetMixin here, since const classes
10 // can't use mixins.
11 /// An unmodifiable, empty set that can have a const constructor.
12 class EmptyUnmodifiableSet<E> extends IterableBase<E>
13 implements UnmodifiableSetView<E> {
14 static T _throw<T>() {
15 throw new UnsupportedError("Cannot modify an unmodifiable Set");
16 }
17
18 Iterator<E> get iterator => new Iterable<E>.empty().iterator;
19 int get length => 0;
20
21 const EmptyUnmodifiableSet();
22
23 bool contains(Object element) => false;
24 bool containsAll(Iterable<Object> other) => other.isEmpty;
25 E lookup(Object element) => null;
26 Set<E> toSet() => new Set();
27 Set<E> union(Set<E> other) => new Set.from(other);
28 Set<E> intersection(Set<Object> other) => new Set();
29 Set<E> difference(Set<Object> other) => new Set();
30
31 bool add(E value) => _throw();
32 void addAll(Iterable<E> elements) => _throw();
33 void clear() => _throw();
34 bool remove(Object element) => _throw();
35 void removeAll(Iterable<Object> elements) => _throw();
36 void removeWhere(bool test(E element)) => _throw();
37 void retainWhere(bool test(E element)) => _throw();
38 void retainAll(Iterable<Object> elements) => _throw();
39 }
OLDNEW
« no previous file with comments | « packages/collection/lib/src/comparators.dart ('k') | packages/collection/lib/src/equality.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698