Example #1
0
 /**
  * {@inheritDoc}
  *
  * @see java.util.NavigableSet#headSet(Object, boolean)
  * @since 1.6
  */
 @SuppressWarnings("unchecked")
 public NavigableSet<E> headSet(E end, boolean endInclusive) {
   // Check for errors
   Comparator<? super E> c = backingMap.comparator();
   if (c == null) {
     ((net.sourceforge.retroweaver.harmony.runtime.java.lang.Comparable<E>) end).compareTo(end);
   } else {
     c.compare(end, end);
   }
   return new TreeSet<E>(backingMap.headMap(end, endInclusive));
 }
Example #2
0
 /**
  * @throws ClassCastException {@inheritDoc}
  * @throws NullPointerException if {@code toElement} is null and this set uses natural ordering,
  *     or its comparator does not permit null elements
  * @throws IllegalArgumentException {@inheritDoc}
  * @since 1.6
  */
 public NavigableSet<E> headSet(E toElement, boolean inclusive) {
   return new TreeSet<E>(m.headMap(toElement, inclusive));
 }