196 |
|
* @return <tt>true</tt> if this set contains the specified element |
197 |
|
* @throws ClassCastException if the specified object cannot be compared |
198 |
|
* with the elements currently in the set |
199 |
< |
* @throws NullPointerException if the specified element is null and |
200 |
< |
* this set uses natural ordering and is non-empty, or its |
201 |
< |
* comparator does not permit null elements |
199 |
> |
* @throws NullPointerException if the specified element is null |
200 |
> |
* and this set uses natural ordering, or its comparator |
201 |
> |
* does not permit null elements |
202 |
|
*/ |
203 |
|
public boolean contains(Object o) { |
204 |
|
return m.containsKey(o); |
212 |
|
* element |
213 |
|
* @throws ClassCastException if the specified object cannot be compared |
214 |
|
* with the elements currently in the set |
215 |
< |
* @throws NullPointerException if the specified element is null and |
216 |
< |
* this set uses natural ordering and is non-empty, or its |
217 |
< |
* comparator does not permit null elements |
215 |
> |
* @throws NullPointerException if the specified element is null |
216 |
> |
* and this set uses natural ordering, or its comparator |
217 |
> |
* does not permit null elements |
218 |
|
*/ |
219 |
|
public boolean add(E e) { |
220 |
|
return m.put(e, PRESENT)==null; |
227 |
|
* @return <tt>true</tt> if the set contained the specified element |
228 |
|
* @throws ClassCastException if the specified object cannot be compared |
229 |
|
* with the elements currently in the set |
230 |
< |
* @throws NullPointerException if the specified element is null and |
231 |
< |
* this set uses natural ordering and is non-empty, or its |
232 |
< |
* comparator does not permit null elements |
230 |
> |
* @throws NullPointerException if the specified element is null |
231 |
> |
* and this set uses natural ordering, or its comparator |
232 |
> |
* does not permit null elements |
233 |
|
*/ |
234 |
|
public boolean remove(Object o) { |
235 |
|
return m.remove(o)==PRESENT; |
374 |
|
|
375 |
|
/** |
376 |
|
* @throws ClassCastException {@inheritDoc} |
377 |
< |
* @throws NullPointerException if the specified element is null and |
378 |
< |
* this set uses natural ordering and is non-empty, |
379 |
< |
* or its comparator does not permit null elements |
377 |
> |
* @throws NullPointerException if the specified element is null |
378 |
> |
* and this set uses natural ordering, or its comparator |
379 |
> |
* does not permit null elements |
380 |
|
*/ |
381 |
|
public E lower(E e) { |
382 |
|
return m.lowerKey(e); |
384 |
|
|
385 |
|
/** |
386 |
|
* @throws ClassCastException {@inheritDoc} |
387 |
< |
* @throws NullPointerException if the specified element is null and |
388 |
< |
* this set uses natural ordering and is non-empty, |
389 |
< |
* or its comparator does not permit null elements |
387 |
> |
* @throws NullPointerException if the specified element is null |
388 |
> |
* and this set uses natural ordering, or its comparator |
389 |
> |
* does not permit null elements |
390 |
|
*/ |
391 |
|
public E floor(E e) { |
392 |
|
return m.floorKey(e); |
394 |
|
|
395 |
|
/** |
396 |
|
* @throws ClassCastException {@inheritDoc} |
397 |
< |
* @throws NullPointerException if the specified element is null and |
398 |
< |
* this set uses natural ordering and is non-empty, |
399 |
< |
* or its comparator does not permit null elements |
397 |
> |
* @throws NullPointerException if the specified element is null |
398 |
> |
* and this set uses natural ordering, or its comparator |
399 |
> |
* does not permit null elements |
400 |
|
*/ |
401 |
|
public E ceiling(E e) { |
402 |
|
return m.ceilingKey(e); |
404 |
|
|
405 |
|
/** |
406 |
|
* @throws ClassCastException {@inheritDoc} |
407 |
< |
* @throws NullPointerException if the specified element is null and |
408 |
< |
* this set uses natural ordering and is non-empty, |
409 |
< |
* or its comparator does not permit null elements |
407 |
> |
* @throws NullPointerException if the specified element is null |
408 |
> |
* and this set uses natural ordering, or its comparator |
409 |
> |
* does not permit null elements |
410 |
|
*/ |
411 |
|
public E higher(E e) { |
412 |
|
return m.higherKey(e); |