Spec-Zone.ru › Dart 1

dart:collection

Метод containsValue

bool containsValue(Object value)

Возвращает true, если эта карта содержит заданное value.

Возвращает true, если любое из значений в карте равно value в соответствии с оператором ==.

Исходный код

bool containsValue(Object value) {
  bool found = false;
  int initialSplayCount = _splayCount;
  bool visit(_SplayTreeMapNode node) {
    while (node != null) {
      if (node.value == value) return true;
      if (initialSplayCount != _splayCount) {
        throw new ConcurrentModificationError(this);
      }
      if (node.right != null && visit(node.right)) return true;
      node = node.left;
    }
    return false;
  }

  return visit(_root);
}

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-collection/SplayTreeMap/containsValue.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API