public class OffsetList
extends java.lang.Object
The algorithms here use traversal of the list segments rather than recursion to avoid using a lot of stack space.
Modifier and Type | Class and Description |
---|---|
static class |
OffsetList.Segment
One segment of a OffsetList containing at most SEGMENT_CAPACITY values.
|
Modifier and Type | Field and Description |
---|---|
(package private) static int |
SEGMENT_CAPACITY |
(package private) static int |
TOO_BIG_FOR_SELF_CHECK |
Constructor and Description |
---|
OffsetList() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(long value,
boolean checkDupOffsets)
Adds the given value and returns whether a new segment was allocated.
|
(package private) boolean |
contains(long offset)
Returns whether this list contains the given offset.
|
(package private) boolean |
merge(OffsetList other)
Merges the given list and returns whether a segment was freed.
|
int |
size() |
long[] |
toArray()
Returns an array of all values as longs.
|
static final int SEGMENT_CAPACITY
static final int TOO_BIG_FOR_SELF_CHECK
public boolean add(long value, boolean checkDupOffsets)
public int size()
boolean merge(OffsetList other)
public long[] toArray()
boolean contains(long offset)
Copyright (c) 2004-2012 Oracle. All rights reserved.