()
| 895 | } |
| 896 | |
| 897 | public Iterator<K> iterator() { |
| 898 | Node<K, V> from; |
| 899 | int fromIndex; |
| 900 | if (subMap.hasStart) { |
| 901 | subMap.setFirstKey(); |
| 902 | from = subMap.firstKeyNode; |
| 903 | fromIndex = subMap.firstKeyIndex; |
| 904 | } else { |
| 905 | from = minimum(subMap.backingMap.root); |
| 906 | fromIndex = from != null ? from.left_idx : 0; |
| 907 | } |
| 908 | if (!subMap.hasEnd) { |
| 909 | return new UnboundedKeyIterator<K, V>(subMap.backingMap, from, |
| 910 | from == null ? 0 : from.right_idx - fromIndex); |
| 911 | } |
| 912 | subMap.setLastKey(); |
| 913 | Node<K, V> to = subMap.lastKeyNode; |
| 914 | int toIndex = subMap.lastKeyIndex; |
| 915 | return new BoundedKeyIterator<K, V>(from, |
| 916 | from == null ? 0 : from.right_idx - fromIndex, subMap.backingMap, to, |
| 917 | to == null ? 0 : to.right_idx - toIndex); |
| 918 | } |
| 919 | } |
| 920 | |
| 921 | static class SubMapValuesCollection <K,V> extends AbstractCollection<V> { |
nothing calls this directly
no test coverage detected