| 3841 | /// @return `true` if this map contains the specified value, |
| 3842 | /// `false` otherwise. |
| 3843 | @Override |
| 3844 | public boolean containsValue(Object value) { |
| 3845 | if (root == null) { |
| 3846 | return false; |
| 3847 | } |
| 3848 | Node<K, V> node = minimum(root); |
| 3849 | if (value != null) { |
| 3850 | while (node != null) { |
| 3851 | int to = node.right_idx; |
| 3852 | V[] values = node.values; |
| 3853 | for (int i = node.left_idx; i <= to; i++) { |
| 3854 | if (value.equals(values[i])) { |
| 3855 | return true; |
| 3856 | } |
| 3857 | } |
| 3858 | node = node.next; |
| 3859 | } |
| 3860 | } else { |
| 3861 | while (node != null) { |
| 3862 | int to = node.right_idx; |
| 3863 | V[] values = node.values; |
| 3864 | for (int i = node.left_idx; i <= to; i++) { |
| 3865 | if (values[i] == null) { |
| 3866 | return true; |
| 3867 | } |
| 3868 | } |
| 3869 | node = node.next; |
| 3870 | } |
| 3871 | } |
| 3872 | return false; |
| 3873 | } |
| 3874 | |
| 3875 | private boolean containsValue(Entry<K, V> node, Object value) { |
| 3876 | if (value == null ? node.value == null : value.equals(node.value)) { |