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

import java.util.List;
import net.ranides.assira.collection.IntCollection;
import net.ranides.assira.collection.arrays.IntArrays;
import net.ranides.assira.collection.iterators.IntListIterator;

/**
 *
 * @author Ranides Atterwim <ranides@gmail.com>
 */
public interface IntList extends IntCollection, List<Integer> {
    
    IntList EMPTY = IntArrays.asList();
	
    void add(int index, int k);

    boolean addAll(IntList list);

    boolean addAll(int index, IntCollection values);

    boolean addAll(int index, IntList values);

    void addElements(int index, int[] a);

    /**
     * Adds elements to this type-specific list using optimized system calls.
     *
     * @param index the index at which to add elements.
     * @param array the array containing the elements.
     * @param offset the offset of the first element to add.
     * @param length the number of elements to add.
     */
    void addElements(int index, int[] array, int offset, int length);

    /**
     * Copies element of this type-specific list into the given array using
     * optimized system calls.
     *
     * @param from the start index (inclusive).
     * @param target the destination array.
     * @param offset the offset into the destination array where to store the
    first element copied.
     * @param length the number of elements to be copied.
     */
    void getElements(int from, int[] target, int offset, int length);

    int getInt(int index);

    /**
     * Returns the hash code for this list, which is identical to
     * {@link java.util.List#hashCode()}.
     *
     * @return the hash code for this list.
     */
    @Override
    int hashCode();

    int indexOf(int k);

    @Override
    IntListIterator iterator();

    int lastIndexOf(int k);

    @Override
    IntListIterator listIterator();

    @Override
    IntListIterator listIterator(int index);

    int peek(int i);

    int pop();

    void push(int o);

    int top();

    /**
     * Removes elements of this type-specific list using optimized system calls.
     *
     * @param from the start index (inclusive).
     * @param to the end index (exclusive).
     */
    void removeElements(int from, int to);

    int removeInt(int index);

    int set(int index, int k);

    @Override
    IntList subList(int from, int to);

}
