cast<R> method

Queue<R> cast <R>()
override

Provides a view of this iterable as an iterable of R instances.

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

When the returned iterable creates a new object that depends on the type R, e.g., from toList, it will have exactly the type R.

Implementation

Queue<R> cast<R>() => Queue.castFrom<E, R>(this);

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.13.0/dart-collection/ListQueue/cast.html