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

import java.util.SortedMap;
import net.ranides.assira.collection.IntCollection;
import net.ranides.assira.collection.sets.ASortedSet;

/**
 *
 * @author Ranides Atterwim <ranides@gmail.com>
 */
public interface SortedLookup<K> extends SortedMap<K, Integer>, Lookup<K> {

    @Override
    ASortedSet<Entry<K, Integer>> 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<Lookup.LookupEntry<K>> fastEntrySet();

    /**
     * Returns a view of the portion of this sorted map whose keys are strictly
     * less than <code>toKey</code>.
     *
     * <P>Note that this specification strengthens the one given in
     * {@link SortedMap#headMap(Object)}.
     *
     * @see SortedMap#headMap(Object)
     */
    @Override
    SortedLookup<K> headMap(K end);

    @Override
    ASortedSet<K> keySet();

    /**
     * Returns a view of the portion of this sorted map whose keys range from
     * <code>fromKey</code>, inclusive, to
     * <code>toKey</code>, exclusive.
     *
     * <P>Note that this specification strengthens the one given in
     * {@link SortedMap#subMap(Object,Object)}.
     *
     * @see SortedMap#subMap(Object,Object)
     */
    @Override
    SortedLookup<K> subMap(K begin, K end);

    /**
     * Returns a view of the portion of this sorted map whose keys are greater
     * than or equal to
     * <code>fromKey</code>.
     *
     * <P>Note that this specification strengthens the one given in
     * {@link SortedMap#tailMap(Object)}.
     *
     * @see SortedMap#tailMap(Object)
     */
    @Override
    SortedLookup<K> tailMap(K begin);

    /**
     * Returns a type-specific sorted collection.
     * @return a type-specific collection view of the values contained in this map
     */
    @Override
    IntCollection values();
    
}
