get<E> method
Get the index
th element.
If index
is out of range and the value is not E
, defaultValue
is returned.
index
番目の要素を取得します。
index
が範囲外、値がE
でない場合、defaultValue
が返されます。
Implementation
E get<E>(int index, E defaultValue) {
if (!containsIndex(index) || this[index] is! E) {
return defaultValue;
}
return this[index] as E;
}