Package com.carrotsearch.hppc
Interface ShortIndexedContainer
-
- All Superinterfaces:
java.lang.Iterable<ShortCursor>
,java.util.RandomAccess
,ShortCollection
,ShortContainer
- All Known Implementing Classes:
ShortArrayList
,ShortStack
@Generated(date="2024-05-16T12:00:00+0000", value="KTypeIndexedContainer.java") public interface ShortIndexedContainer extends ShortCollection, java.util.RandomAccess
An indexed container provides random access to elements based on anindex
. Indexes are zero-based.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(short e1)
Adds an element to the end of this container (the last index is incremented by one).short
get(int index)
int
indexOf(short 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, short e1)
Inserts the specified element at the specified position in this list.int
lastIndexOf(short 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.short
remove(int index)
Removes the element at the specified position in this container and returns it.int
removeFirst(short e1)
Removes the first element that equalse1
, returning its deleted position or-1
if the element was not found.int
removeLast(short e1)
Removes the last element that equalse1
, 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 betweenfromIndex
, inclusive, andtoIndex
, exclusive.short
set(int index, short e1)
Replaces the element at the specified position in this list with the specified element.
-
-
-
Method Detail
-
removeFirst
int removeFirst(short e1)
Removes the first element that equalse1
, returning its deleted position or-1
if the element was not found.
-
removeLast
int removeLast(short e1)
Removes the last element that equalse1
, returning its deleted position or-1
if the element was not found.
-
indexOf
int indexOf(short 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(short 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(short e1)
Adds an element to the end of this container (the last index is incremented by one).
-
insert
void insert(int index, short 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
short set(int index, short e1)
Replaces the element at the specified position in this list with the specified element.- Returns:
- Returns the previous value in the list.
-
get
short get(int index)
- Returns:
- Returns the element at index
index
from the list.
-
remove
short remove(int index)
Removes the element at the specified position in this container and returns it.
-
removeRange
void removeRange(int fromIndex, int toIndex)
Removes from this container all of the elements with indexes betweenfromIndex
, inclusive, andtoIndex
, exclusive.
-
-