Interface IntIndexedContainer

All Superinterfaces:
IntCollection, IntContainer, Iterable<IntCursor>, RandomAccess
All Known Implementing Classes:
IntArrayList, IntStack

@Generated(date="2024-06-04T15:20:17+0200", value="KTypeIndexedContainer.java") public interface IntIndexedContainer extends IntCollection, RandomAccess
An indexed container provides random access to elements based on an index. Indexes are zero-based.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(int e1)
    Adds an element to the end of this container (the last index is incremented by one).
    int
    get(int index)
     
    int
    indexOf(int e1)
    Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.
    void
    insert(int index, int e1)
    Inserts the specified element at the specified position in this list.
    int
    lastIndexOf(int e1)
    Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element.
    int
    removeAt(int index)
    Removes the element at the specified position in this container and returns it.
    boolean
    removeElement(int e1)
    Removes the first element that equals e1, returning whether an element has been removed.
    int
    removeFirst(int e1)
    Removes the first element that equals e1, returning its deleted position or -1 if the element was not found.
    int
    Removes and returns the last element of this container.
    int
    removeLast(int e1)
    Removes the last element that equals e1, returning its deleted position or -1 if the element was not found.
    void
    removeRange(int fromIndex, int toIndex)
    Removes from this container all of the elements with indexes between fromIndex, inclusive, and toIndex, exclusive.
    Reverses the elements in this container and returns this container.
    int
    set(int index, int e1)
    Replaces the element at the specified position in this list with the specified element.
    Sorts the elements in this container and returns this container.
    Returns this container elements as a stream.

    Methods inherited from interface com.carrotsearch.hppc.IntCollection

    clear, release, removeAll, removeAll, removeAll, retainAll, retainAll

    Methods inherited from interface com.carrotsearch.hppc.IntContainer

    contains, forEach, isEmpty, iterator, size, toArray

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Method Details

    • removeElement

      boolean removeElement(int e1)
      Removes the first element that equals e1, returning whether an element has been removed.
    • removeFirst

      int removeFirst(int e1)
      Removes the first element that equals e1, returning its deleted position or -1 if the element was not found.
    • removeLast

      int removeLast(int e1)
      Removes the last element that equals e1, returning its deleted position or -1 if the element was not found.
    • indexOf

      int indexOf(int e1)
      Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.
    • lastIndexOf

      int lastIndexOf(int e1)
      Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element.
    • add

      void add(int e1)
      Adds an element to the end of this container (the last index is incremented by one).
    • insert

      void insert(int index, int e1)
      Inserts the specified element at the specified position in this list.
      Parameters:
      index - The index at which the element should be inserted, shifting any existing and subsequent elements to the right.
    • set

      int set(int index, int e1)
      Replaces the element at the specified position in this list with the specified element.
      Returns:
      Returns the previous value in the list.
    • get

      int get(int index)
      Returns:
      Returns the element at index index from the list.
    • removeAt

      int removeAt(int index)
      Removes the element at the specified position in this container and returns it.
      See Also:
    • removeLast

      int removeLast()
      Removes and returns the last element of this container. This container must not be empty.
    • removeRange

      void removeRange(int fromIndex, int toIndex)
      Removes from this container all of the elements with indexes between fromIndex, inclusive, and toIndex, exclusive.
    • stream

      IntStream stream()
      Returns this container elements as a stream.
    • sort

      Sorts the elements in this container and returns this container.
    • reverse

      Reverses the elements in this container and returns this container.