@Generated(date="2015-02-05T14:42:01+0000", value="HPPC generated from: CharIndexedContainer.java") public interface CharIndexedContainer extends CharCollection, java.util.RandomAccess
index
. Indexes are zero-based.Modifier and Type | Method and Description |
---|---|
void |
add(char e1)
Adds an element to the end of this container (the last index is incremented by one).
|
boolean |
equals(java.lang.Object obj)
Compares the specified object with this container for equality.
|
char |
get(int index) |
int |
hashCode() |
int |
indexOf(char 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,
char e1)
Inserts the specified element at the specified position in this list.
|
int |
lastIndexOf(char 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.
|
char |
remove(int index)
Removes the element at the specified position in this list and returns it.
|
int |
removeFirstOccurrence(char e1)
Removes the first element that equals
e1 , returning its
deleted position or -1 if the element was not found. |
int |
removeLastOccurrence(char 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 list all of the elements whose index is between
fromIndex , inclusive, and toIndex , exclusive. |
char |
set(int index,
char e1)
Replaces the element at the specified position in this list
with the specified element.
|
clear, removeAll, removeAll, removeAllOccurrences, retainAll, retainAll
int removeFirstOccurrence(char e1)
e1
, returning its
deleted position or -1
if the element was not found.int removeLastOccurrence(char e1)
e1
, returning its
deleted position or -1
if the element was not found.int indexOf(char e1)
int lastIndexOf(char e1)
void add(char e1)
void insert(int index, char e1)
index
- The index at which the element should be inserted, shifting
any existing and subsequent elements to the right.char set(int index, char e1)
char get(int index)
index
from the list.char remove(int index)
Careful. Do not confuse this method with the overridden signature in
Java Collections (List.remove(Object)
). Use: CharCollection.removeAll(com.carrotsearch.hppc.CharLookupContainer)
,
removeFirstOccurrence(char)
or removeLastOccurrence(char)
depending
on the actual need.
void removeRange(int fromIndex, int toIndex)
fromIndex
, inclusive, and toIndex
, exclusive.boolean equals(java.lang.Object obj)
CharIndexedContainer
, both have the same size, and all corresponding
pairs of elements at the same index are equal. In other words, two indexed
containers are defined to be equal if they contain the same elements in the same
order.
Note that, unlike in List
, containers may be of different types and still
return true
from equals(java.lang.Object)
. This may be dangerous if you use
different hash functions in two containers, but don't override the default
implementation of equals(java.lang.Object)
. It is the programmer's responsibility to
enforcing these contracts properly.
equals
in class java.lang.Object
int hashCode()
hashCode
in class java.lang.Object
List.hashCode()
(should be implemented
with the same algorithm).Copyright © 2015 Carrot Search s.c.. All rights reserved.