get<E> method

E get<E>(
  1. int index,
  2. E defaultValue
)

Get the indexth element.

If index is out of range, or is itself Null, or the value is not E, defaultValue is returned.

index番目の要素を取得します。

indexが範囲外、もしくは自身がNull、値がEでない場合、defaultValueが返されます。

Implementation

E get<E>(int index, E defaultValue) {
  if (this == null || !containsIndex(index) || this![index] is! E) {
    return defaultValue;
  }
  return this![index] as E;
}