Code example for SortedSet

Methods: comparator

0
		super(base);
		set = (SortedSet<E>) base;
	} 
 
	public Comparator<? super E> comparator() {
		return set.comparator();
	} 
 
	private ObservableSortedSet<E> doSub(SortedSet<E> baseSubSet) {
		ObservableSortedSet<E> subSet = new ObservableSortedSet<E>(baseSubSet);
		subSet.setObservers(getObservers());
		return subSet;
	} 
 
	public SortedSet<E> subSet(E fromElement, E toElement) {
		return doSub(set.subSet(fromElement, toElement));
	} 
 
	public SortedSet<E> headSet(E toElement) {
		return doSub(set.headSet(toElement));
	}