MCPcopy Create free account
hub / github.com/antlr/codebuff / removeOnlyNavigableSet

Method removeOnlyNavigableSet

output/java_guava/1.4.17/Maps.java:1098–1151  ·  view source on GitHub ↗
(final NavigableSet<E> set)

Source from the content-addressed store, hash-verified

1096 }
1097
1098 @GwtIncompatible // NavigableSet
1099 private static <E> NavigableSet<E> removeOnlyNavigableSet(final NavigableSet<E> set) {
1100 return new ForwardingNavigableSet<E>() {
1101 @Override
1102 protected NavigableSet<E> delegate() {
1103 return set;
1104 }
1105
1106 @Override
1107 public boolean add(E element) {
1108 throw new UnsupportedOperationException();
1109 }
1110
1111 @Override
1112 public boolean addAll(Collection<? extends E> es) {
1113 throw new UnsupportedOperationException();
1114 }
1115
1116 @Override
1117 public SortedSet<E> headSet(E toElement) {
1118 return removeOnlySortedSet(super.headSet(toElement));
1119 }
1120
1121 @Override
1122 public SortedSet<E> subSet(E fromElement, E toElement) {
1123 return removeOnlySortedSet(super.subSet(fromElement, toElement));
1124 }
1125
1126 @Override
1127 public SortedSet<E> tailSet(E fromElement) {
1128 return removeOnlySortedSet(super.tailSet(fromElement));
1129 }
1130
1131 @Override
1132 public NavigableSet<E> headSet(E toElement, boolean inclusive) {
1133 return removeOnlyNavigableSet(super.headSet(toElement, inclusive));
1134 }
1135
1136 @Override
1137 public NavigableSet<E> tailSet(E fromElement, boolean inclusive) {
1138 return removeOnlyNavigableSet(super.tailSet(fromElement, inclusive));
1139 }
1140
1141 @Override
1142 public NavigableSet<E> subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive) {
1143 return removeOnlyNavigableSet(super.subSet(fromElement, fromInclusive, toElement, toInclusive));
1144 }
1145
1146 @Override
1147 public NavigableSet<E> descendingSet() {
1148 return removeOnlyNavigableSet(super.descendingSet());
1149 }
1150 };
1151 }
1152
1153 /**
1154 * Returns an immutable map whose keys are the distinct elements of {@code

Callers 5

headSetMethod · 0.95
tailSetMethod · 0.95
subSetMethod · 0.95
descendingSetMethod · 0.95
navigableKeySetMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected