2141 |
|
* @throws NullPointerException if the specified key is null |
2142 |
|
*/ |
2143 |
|
public boolean remove(Object key, Object value) { |
2144 |
+ |
if (key == null) |
2145 |
+ |
throw new NullPointerException(); |
2146 |
|
if (value == null) |
2147 |
|
return false; |
2148 |
|
return doRemove(key, value) != null; |
2782 |
|
public void clear() { |
2783 |
|
ConcurrentSkipListMap.this.clear(); |
2784 |
|
} |
2785 |
+ |
public boolean equals(Object o) { |
2786 |
+ |
if (o == this) |
2787 |
+ |
return true; |
2788 |
+ |
if (!(o instanceof Set)) |
2789 |
+ |
return false; |
2790 |
+ |
Collection<?> c = (Collection<?>) o; |
2791 |
+ |
try { |
2792 |
+ |
return containsAll(c) && c.containsAll(this); |
2793 |
+ |
} catch (ClassCastException unused) { |
2794 |
+ |
return false; |
2795 |
+ |
} catch (NullPointerException unused) { |
2796 |
+ |
return false; |
2797 |
+ |
} |
2798 |
+ |
} |
2799 |
|
} |
2800 |
|
|
2801 |
|
class DescendingKeySet extends KeySet { |
2849 |
|
public void clear() { |
2850 |
|
ConcurrentSkipListMap.this.clear(); |
2851 |
|
} |
2852 |
+ |
public boolean equals(Object o) { |
2853 |
+ |
if (o == this) |
2854 |
+ |
return true; |
2855 |
+ |
if (!(o instanceof Set)) |
2856 |
+ |
return false; |
2857 |
+ |
Collection<?> c = (Collection<?>) o; |
2858 |
+ |
try { |
2859 |
+ |
return containsAll(c) && c.containsAll(this); |
2860 |
+ |
} catch (ClassCastException unused) { |
2861 |
+ |
return false; |
2862 |
+ |
} catch (NullPointerException unused) { |
2863 |
+ |
return false; |
2864 |
+ |
} |
2865 |
+ |
} |
2866 |
|
} |
2867 |
|
|
2868 |
|
class DescendingEntrySet extends EntrySet { |
3197 |
|
public boolean contains(Object k) { |
3198 |
|
return ConcurrentSkipListSubMap.this.containsKey(k); |
3199 |
|
} |
3200 |
+ |
public boolean equals(Object o) { |
3201 |
+ |
if (o == this) |
3202 |
+ |
return true; |
3203 |
+ |
if (!(o instanceof Set)) |
3204 |
+ |
return false; |
3205 |
+ |
Collection<?> c = (Collection<?>) o; |
3206 |
+ |
try { |
3207 |
+ |
return containsAll(c) && c.containsAll(this); |
3208 |
+ |
} catch (ClassCastException unused) { |
3209 |
+ |
return false; |
3210 |
+ |
} catch (NullPointerException unused) { |
3211 |
+ |
return false; |
3212 |
+ |
} |
3213 |
+ |
} |
3214 |
+ |
|
3215 |
|
} |
3216 |
|
|
3217 |
|
public Set<K> descendingKeySet() { |
3279 |
|
return false; |
3280 |
|
return m.remove(key, e.getValue()); |
3281 |
|
} |
3282 |
+ |
public boolean equals(Object o) { |
3283 |
+ |
if (o == this) |
3284 |
+ |
return true; |
3285 |
+ |
if (!(o instanceof Set)) |
3286 |
+ |
return false; |
3287 |
+ |
Collection<?> c = (Collection<?>) o; |
3288 |
+ |
try { |
3289 |
+ |
return containsAll(c) && c.containsAll(this); |
3290 |
+ |
} catch (ClassCastException unused) { |
3291 |
+ |
return false; |
3292 |
+ |
} catch (NullPointerException unused) { |
3293 |
+ |
return false; |
3294 |
+ |
} |
3295 |
+ |
} |
3296 |
|
} |
3297 |
|
|
3298 |
|
public Set<Map.Entry<K,V>> descendingEntrySet() { |