public class SegmentList<T> extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
SEGMENT_SIZE |
| 构造器和说明 |
|---|
SegmentList(boolean recycleSegment)
Create a new SegmentList
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
add(T e) |
void |
addAll(Collection<T> coll) |
void |
clear() |
T |
get(int index) |
boolean |
isEmpty() |
T |
peekFirst() |
T |
peekLast() |
void |
removeFromFirst(int toIndex)
Removes from this list all of the elements whose index is between
0, inclusive, and
toIndex, exclusive. |
void |
removeFromFirstWhen(java.util.function.Predicate<T> predicate)
Remove elements from first until predicate returns false.
|
void |
removeFromLastWhen(java.util.function.Predicate<T> predicate)
Remove elements from last until predicate returns false.
|
int |
segmentSize() |
int |
size() |
String |
toString() |
public static final int SEGMENT_SIZE
public SegmentList(boolean recycleSegment)
recycleSegment - true to enable recycling segment, only effective in same thread.public T get(int index)
public T peekLast()
public T peekFirst()
public void add(T e)
public int size()
public int segmentSize()
public boolean isEmpty()
public void removeFromFirstWhen(java.util.function.Predicate<T> predicate)
predicate - predicate functional interfacepublic void clear()
public void removeFromLastWhen(java.util.function.Predicate<T> predicate)
predicate - predicate functional interfacepublic void removeFromFirst(int toIndex)
toIndex, exclusive.
Shifts any succeeding elements to the left (reduces their index).public void addAll(Collection<T> coll)
Copyright © 2021. All rights reserved.