Example #1
0
 /**
  * Searches this {@code TreeSet} for the specified object.
  *
  * @param object the object to search for.
  * @return {@code true} if {@code object} is an element of this {@code TreeSet}, {@code false}
  *     otherwise.
  * @throws ClassCastException when the object cannot be compared with the elements in this {@code
  *     TreeSet}.
  * @throws NullPointerException when the object is null and the comparator cannot handle null.
  */
 @Override
 public boolean contains(Object object) {
   return backingMap.containsKey(object);
 }
Example #2
0
 /**
  * Returns {@code true} if this set contains the specified element. More formally, returns {@code
  * true} if and only if this set contains an element {@code e} such that
  * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>.
  *
  * @param o object to be checked for containment in this set
  * @return {@code true} if this set contains the specified element
  * @throws ClassCastException if the specified object cannot be compared with the elements
  *     currently in the set
  * @throws NullPointerException if the specified element is null and this set uses natural
  *     ordering, or its comparator does not permit null elements
  */
 public boolean contains(Object o) {
   return m.containsKey(o);
 }