Code example for SortedSet

Methods: comparator

0
	public boolean addAll(Collection<? extends E> c) {
		// Use linear-time version if applicable 
		if (m.size() == 0 && c.size() > 0 && c instanceof SortedSet && m instanceof OMVRBTree) {
			SortedSet<? extends E> set = (SortedSet<? extends E>) c;
			OMVRBTree<E, Object> map = (OMVRBTree<E, Object>) m;
			Comparator<? super E> cc = (Comparator<? super E>) set.comparator();
			Comparator<? super E> mc = map.comparator();
			if (cc == mc || (cc != null && cc.equals(mc))) {
				map.addAllForOTreeSet(set, PRESENT);
				return true; 
			} 
		} 
		return super.addAll(c);
	} 
 
	/** 
	 * @throws ClassCastException 
	 *           {@inheritDoc} 
	 * @throws NullPointerException 
	 *           if {@code fromElement} or {@code toElement} is null and this set uses natural ordering, or its comparator does not