Movatterモバイル変換


[0]ホーム

URL:


menu
  1. Dart
  2. dart:core
  3. Map<K,V>
  4. cast<RK,RV> abstract method
cast
description

cast<RK,RV> abstract method

Map<RK,RV>cast<RK,RV>()

Provides a view of this map as havingRK keys andRV instances,if necessary.

If this map is already aMap<RK, RV>, it is returned unchanged.

If this set contains only keys of typeRK and values of typeRV,all read operations will work correctly.If any operation exposes a non-RK key or non-RV value,the operation will throw instead.

Entries added to the map must be valid for both aMap<K, V> and aMap<RK, RV>.

Methods which acceptObject? as argument,likecontainsKey,remove andoperator [],will pass the argument directly to the this map's methodwithout any checks.That means that you can domapWithStringKeys.cast<int,int>().remove("a")successfully, even if it looks like it shouldn't have any effect.

Implementation

Map<RK, RV> cast<RK, RV>();
  1. Dart
  2. dart:core
  3. Map<K,V>
  4. cast<RK,RV> abstract method
Map class

[8]ページ先頭

©2009-2025 Movatter.jp