/*
 * @author Ranides Atterwim <ranides@gmail.com>
 * @copyright Ranides Atterwim
 * @license WTFPL
 * @url http://ranides.net/projects/assira
 */
package net.ranides.assira.collection.sets;

import java.util.SortedSet;
import net.ranides.assira.collection.IntComparator;
import net.ranides.assira.collection.iterators.IntIterator;
import net.ranides.assira.collection.iterators.IntListIterator;

/**
 *
 * @author Ranides Atterwim <ranides@gmail.com>
 */
public interface IntSortedSet extends IntSet, SortedSet<Integer> {

    @Override
    IntComparator comparator();

    /**
     * @see SortedSet#first()
     */
    int firstInt();

    /**
     * @see SortedSet#headSet(Object)
     */
    IntSortedSet headSet(int end);

    IntSortedSet headSet(Integer end);

    @Override
    IntListIterator iterator();

    /**
     * <P>This method returns a iterator with given
     * starting point. The starting point is any element comparable to the
     * elements of this set (even if it does not actually belong to the set).
     * The next element of the returned iterator is the least element of the set
     * that is greater than the starting point (if there are no elements greater
     * than the starting point, {@link IntIterator#hasNext() hasNext()} will
     * return <code>false</code>).
     *
     * @param begin an element to start from.
     * @return an iterator on the element in this set, starting at
     * the given element.
     * @throws UnsupportedOperationException if this set does not support
     * iterators with a starting point.
     */
    IntListIterator iterator(int begin);

    /**
     * @see SortedSet#last()
     */
    int lastInt();

    /**
     * @see SortedSet#subSet(Object,Object)
     */
    IntSortedSet subSet(int begin, int end);

    @Override
    IntSortedSet subSet(Integer begin, Integer end);

    /**
     * @see SortedSet#tailSet(Object)
     */
    IntSortedSet tailSet(int begin);

    @Override
    IntSortedSet tailSet(Integer begin);
    
}
