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

import net.ranides.assira.collection.IntComparator;
import net.ranides.assira.collection.sets.ASortedSet;
import net.ranides.assira.collection.sets.IntSortedSet;

import java.util.SortedMap;

/**
 * Specialization of SortedMap using integer keys.
 * Avoids unecessary boxing and unboxing operations.
 *
 * @param <V> V
 * @author Ranides Atterwim {@literal <ranides@gmail.com>}
 */
public interface IntSortedMap<V> extends IntMap<V>, SortedMap<Integer, V> {

    @Override
    IntComparator comparator();

    @Override
    ASortedSet<Entry<Integer, V>> entrySet();

    /**
     * Returns a type-specific sorted-set view of the mappings contained in this
     * map. Note that this specification strengthens the one given in the
     * corresponding type-specific unsorted map.
     *
     * @return a type-specific sorted-set view of the mappings contained in this
     * map.
     * @see #entrySet()
     */
    @Override
    ASortedSet<IntMap.IntEntry<V>> fastEntrySet();

    /**
     * non-generic version of method {@link SortedMap#firstKey()}
     *
     * @return int
     */
    int firstIntKey();

    /**
     * non-generic version of method {@link #headMap(Integer)}
     *
     * @param end end
     * @return view
     */
    IntSortedMap<V> headMap(int end);

    @Override
    IntSortedMap<V> headMap(Integer end);

    @Override
    IntSortedSet keySet();

    /**
     * non-generic version of method {@link #lastKey()}
     *
     * @return int
     */
    int lastIntKey();

    @Override
    Integer lastKey();

    /**
     * non-generic version of method {@link #subMap(Integer, Integer)}
     *
     * @param begin begin
     * @param end end
     * @return view
     */
    IntSortedMap<V> subMap(int begin, int end);

    @Override
    IntSortedMap<V> subMap(Integer begin, Integer end);

    /**
     * non-generic version of method {@link #tailMap(Integer)}
     *
     * @param begin begin
     * @return view
     */
    IntSortedMap<V> tailMap(int begin);

    @Override
    IntSortedMap<V> tailMap(Integer begin);
    
}
