W3cubDocs

/Dart 2

cast<R> method

Set<R> cast <R>()

Provides a view of this set as a set of R instances.

If this set contains only instances of R, all read operations will work correctly. If any operation tries to access an element that is not an instance of R, the access will throw instead.

Elements added to the set (e.g., by using add or addAll) must be instance of R to be valid arguments to the adding function, and they must be instances of E as well to be accepted by this set as well.

Implementation

Set<R> cast<R>();

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/2.0.0/dart-core/Set/cast.html