public class DoubleGapList extends IDoubleList
Note that this implementation is not synchronized.
Note that the iterators provided are not fail-fast.
List,
ArrayList,
LinkedList,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_CAPACITY
Default capacity for list
|
| Constructor and Description |
|---|
DoubleGapList()
Construct a list with the default initial capacity.
|
DoubleGapList(java.util.Collection<java.lang.Double> coll)
Construct a list to contain the specified elements.
|
DoubleGapList(int capacity)
Construct a list with specified initial capacity.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(double elem) |
void |
add(int index,
double elem) |
int |
binarySearch(int index,
int len,
double key)
Searches the specified range for an object using the binary
search algorithm.
|
int |
capacity()
Returns capacity of this list.
|
java.lang.Object |
clone()
Returns a shallow copy of this DoubleGapList instance
(The elements themselves are not copied).
|
DoubleGapList |
copy()
Returns a shallow copy of this DoubleGapList instance.
|
static DoubleGapList |
create()
Create new list.
|
static DoubleGapList |
create(java.util.Collection<java.lang.Double> coll)
Create new list with specified elements.
|
static DoubleGapList |
create(double... elems)
Create new list with specified elements.
|
IDoubleList |
doCreate(int capacity)
Create list with specified capacity.
|
static DoubleGapList |
EMPTY() |
void |
ensureCapacity(int minCapacity)
Increases the capacity of this DoubleGapList instance, if
necessary, to ensure that it can hold at least the number of elements
specified by the minimum capacity argument.
|
double |
get(int index) |
DoubleGapList |
getAll(double elem)
Returns all elements in the list equal to the specified element.
|
DoubleGapList |
getAll(int index,
int len)
Returns specified range of elements from list.
|
double |
getDefaultElem() |
void |
init()
Initialize the list to be empty.
|
void |
init(java.util.Collection<java.lang.Double> coll)
Initialize the list to contain the specified elements only.
|
void |
init(double... elems)
Initialize the list to contain the specified elements only.
|
<R> GapList<R> |
mappedList(IFunction<java.lang.Double,R> mapper)
Create a new list by applying the specified mapper to all elements.
|
double |
remove(int index) |
int |
size() |
void |
sort(int index,
int len)
Sort specified elements in the list using the specified comparator.
|
void |
trimToSize()
Trims the capacity of this DoubleGapList instance to be the list's current size.
|
DoubleGapList |
unmodifiableList()
Returns an unmodifiable view of this list.
|
addAll, addAll, addAll, addAll, addArray, addArray, addFirst, addIfAbsent, addLast, addMult, addMult, binarySearch, clear, contains, containsAll, containsAny, copy, drag, element, equals, extract, extractWhere, fill, filter, getArray, getCount, getDistinct, getFirst, getLast, getWhere, hashCode, indexOf, indexOf, initAll, initAll, initArray, initMult, isEmpty, lastIndexOf, lastIndexOf, move, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, put, putAll, putAll, putArray, putMult, remove, remove, removeAll, removeAll, removeAll, removeElem, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, removeWhere, replaceAll, replaceAll, replaceArray, replaceMult, resize, retainAll, retainAll, retainWhere, reverse, reverse, rotate, rotate, set, setAll, setAll, setArray, setMult, sort, swap, toArray, toArray, toArray, toString, transferCopy, transferMove, transferRemove, transferSwappublic static final int DEFAULT_CAPACITY
public DoubleGapList()
public DoubleGapList(int capacity)
capacity - capacitypublic DoubleGapList(java.util.Collection<java.lang.Double> coll)
coll - collection with elementspublic static DoubleGapList EMPTY()
public static DoubleGapList create()
type - of elements stored in the listpublic static DoubleGapList create(java.util.Collection<java.lang.Double> coll)
coll - collection with elementtype - of elements stored in the listpublic static DoubleGapList create(double... elems)
elems - array with elementstype - of elements stored in the listpublic void init()
public void init(java.util.Collection<java.lang.Double> coll)
coll - collection with elementspublic void init(double... elems)
elems - array with elementspublic double getDefaultElem()
public DoubleGapList copy()
copy in class IDoubleListIDoubleList.clone()public void ensureCapacity(int minCapacity)
ensureCapacity in class IDoubleListminCapacity - the desired minimum capacitypublic java.lang.Object clone()
clone in class IDoubleListpublic DoubleGapList unmodifiableList()
IDoubleListunmodifiableList in class IDoubleListpublic int size()
size in class IDoubleListpublic int capacity()
IDoubleListcapacity in class IDoubleListpublic double get(int index)
get in class IDoubleListpublic boolean add(double elem)
add in class IDoubleListpublic void add(int index,
double elem)
add in class IDoubleListpublic DoubleGapList getAll(int index, int len)
IDoubleListgetAll in class IDoubleListindex - index of first element to retrievelen - number of elements to retrievepublic DoubleGapList getAll(double elem)
IDoubleListgetAll in class IDoubleListelem - element to look forpublic <R> GapList<R> mappedList(IFunction<java.lang.Double,R> mapper)
IDoubleListmappedList in class IDoubleListmapper - mapper functionpublic double remove(int index)
remove in class IDoubleListpublic void trimToSize()
trimToSize in class IDoubleListpublic IDoubleList doCreate(int capacity)
IDoubleListcapacity - initial capacity (use -1 for default capacity)public void sort(int index,
int len)
IDoubleListsort in class IDoubleListindex - index of first element to sortlen - number of elements to sortArrays.sort(int[])public int binarySearch(int index,
int len,
double key)
IDoubleListbinarySearch in class IDoubleListindex - index of first element to searchlen - number of elements to searchkey - the value to be searched forArrays.binarySearch(long[], long)