Package one.microstream.collections
Class _intList
- java.lang.Object
-
- one.microstream.collections._intList
-
- All Implemented Interfaces:
_intCollecting,Composition
public final class _intList extends Object implements _intCollecting, Composition
- Version:
- 0.95, 2011 - 12 - 12
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class_intList.Factory
-
Constructor Summary
Constructors Constructor Description _intList()Default constructor instantiating an empty instance with default (minimum) capacity._intList(int initialCapacity)Initial capacity constructor instantiating an empty instance with a given initial capacity._intList(int... elements)Convenience initial data constructor, instantiating a new instance containing all elements of the passed array._intList(int initialCapacity, int[] src, int srcStart, int srcLength)Detailed initializing constructor allowing to specify initial capacity and a custom array range of initial data._intList(_intList original)Copy constructor that instantiates a new instance with a copy of the passed original instance's data and same size.
-
Method Summary
Modifier and Type Method Description voidaccept(int element)booleanadd(int element)_intListadd(int... elements)_intListaddAll(int[] elements, int offset, int length)_intListaddAll(_intList elements)booleanapplies(_intPredicate predicate)voidclear()intconsolidate()booleancontains(int element)booleancontainsAll(_intList elements)booleancontainsSearched(_intPredicate predicate)_intListcopy()_intCollectingcopySelection(_intCollecting target, long... indices)int[]copyTo(int[] target, int offset)int[]copyTo(int[] target, int targetOffset, int offset, int length)<C extends _intCollecting>
CcopyTo(C target)_intCollectingcopyTo(_intCollecting target, _intPredicate predicate)intcount(int element)intcount(_intPredicate predicate)intcurrentCapacity()_intListensureCapacity(int minCapacity)_intListensureFreeCapacity(int requiredFreeCapacity)intfetch()_intListfill(int offset, int length, int element)intfirst()intfreeCapacity()intget(int index)booleanhasVolatileElements()intindexOf(int element)intindexOf(_intPredicate predicate)booleaninput(int index, int element)intinput(int index, int... elements)intinputAll(int index, int[] elements, int offset, int length)intinputAll(int index, _intList elements)booleaninsert(int index, int element)intinsert(int index, int... elements)intinsertAll(int index, int[] elements, int offset, int length)intinsertAll(int index, _intList elements)booleanisEmpty()booleanisFull()booleanisSorted(boolean ascending)_intListiterate(_intIndexProcedure procedure)_intListiterate(_intProcedure procedure)intlast()intlastIndexOf(int element)intlastIndexOf(_intPredicate predicate)intmax()intmaximumCapacity()intmin()intmodify(_intFunction mapper)intmodify(_intPredicate predicate, _intFunction mapper)_intCollectingmoveSelection(_intCollecting target, long... indices)_intCollectingmoveTo(_intCollecting target, _intPredicate predicate)booleannullAdd()booleannullAllowed()booleannullPut()intoptimize()intpick()intpinch()intpop()booleanprepend(int element)_intListprepend(int... elements)_intListprependAll(int[] elements, int offset, int length)_intListprependAll(_intList elements)booleanpreput(int element)_intListpreput(int... elements)_intListpreputAll(int[] elements, int offset, int length)_intListpreputAll(_intList elements)_intListprocess(_intProcedure procedure)booleanput(int element)_intListput(int... elements)_intListputAll(int[] elements, int offset, int length)_intListputAll(_intList elements)intremove(int element)intremove(_intPredicate predicate)intremoveAll(_intList elements)intremoveAt(int index)intremoveDuplicates()booleanremoveOne(int element)_intListremoveRange(int startIndex, int length)intremoveSelection(int[] indices)intreplace(int element, int replacement)intreplace(_intPredicate predicate, int substitute)intreplaceAll(_intList elements, int replacement)Deprecated.booleanreplaceOne(int element, int replacement)booleanreplaceOne(_intPredicate predicate, int substitute)intretrieve(int element)intretrieve(_intPredicate predicate)_intListreverse()intscan(_intPredicate predicate)intsearch(_intPredicate predicate)booleanset(int index, int element)_intListset(int offset, int... elements)_intListset(int offset, int[] src, int srcIndex, int srcLength)voidsetFirst(int element)intsetGet(int index, int element)voidsetLast(int element)_intListshiftBy(int sourceIndex, int distance)_intListshiftBy(int sourceIndex, int distance, int length)_intListshiftTo(int sourceIndex, int targetIndex)_intListshiftTo(int sourceIndex, int targetIndex, int length)intsize()_intListsort()_intListswap(int indexA, int indexB)_intListswap(int indexA, int indexB, int length)int[]toArray()_intListtoReversed()StringtoString()voidtruncate()
-
-
-
Constructor Detail
-
_intList
public _intList()
Default constructor instantiating an empty instance with default (minimum) capacity.
-
_intList
public _intList(int initialCapacity)
Initial capacity constructor instantiating an empty instance with a given initial capacity.The actual initial capacity is the highest of the following three values:
-
IntegerMAX_VALUE, if the given initial capacity is greater than 2^30. - The lowest power of two value that is equal to or greater than the given initial capacity.
- The default (minimum) capacity.
- Parameters:
initialCapacity- the desired custom initial capacity.
-
-
_intList
public _intList(_intList original) throws NullPointerException
Copy constructor that instantiates a new instance with a copy of the passed original instance's data and same size.- Parameters:
original- the instance to be copied.- Throws:
NullPointerException- ifnullwas passed.- See Also:
copy()
-
_intList
public _intList(int... elements) throws NullPointerExceptionConvenience initial data constructor, instantiating a new instance containing all elements of the passed array. The element size of the new instance will be equal to the passed array's length.Note that providing no element at all in the VarArgs parameter will automatically cause the default constructor
_intList()to be used instead. Explicitely providing annullarray reference will cause aNullPointerException.- Parameters:
elements- the initial elements for the new instance.- Throws:
NullPointerException- if an explicitnullarray reference was passed.- See Also:
_intList()
-
_intList
public _intList(int initialCapacity, int[] src, int srcStart, int srcLength)Detailed initializing constructor allowing to specify initial capacity and a custom array range of initial data.The actual initial capacity will be calculated based on the higher of the two values
initialCapacityandsrcLengthas described in_intList(int).The specified initial elements array range is copied via
System.arraycopy(java.lang.Object, int, java.lang.Object, int, int).- Parameters:
initialCapacity- the desired initial capacity for the new instance.src- the source array containg the desired range of initial elements.srcStart- the start index of the desired range of initial elements in the source array.srcLength- the length of the desired range of initial elements in the source array.
-
-
Method Detail
-
copy
public _intList copy()
-
toReversed
public _intList toReversed()
-
toArray
public int[] toArray()
-
iterate
public _intList iterate(_intProcedure procedure)
-
iterate
public _intList iterate(_intIndexProcedure procedure)
-
count
public int count(int element)
-
count
public int count(_intPredicate predicate)
-
indexOf
public int indexOf(int element)
-
indexOf
public int indexOf(_intPredicate predicate)
-
lastIndexOf
public int lastIndexOf(int element)
-
lastIndexOf
public int lastIndexOf(_intPredicate predicate)
-
scan
public int scan(_intPredicate predicate)
-
first
public int first()
-
last
public int last()
-
search
public int search(_intPredicate predicate)
-
max
public int max()
-
min
public int min()
-
hasVolatileElements
public boolean hasVolatileElements()
-
nullAllowed
public boolean nullAllowed()
-
isSorted
public boolean isSorted(boolean ascending)
-
containsSearched
public boolean containsSearched(_intPredicate predicate)
-
applies
public boolean applies(_intPredicate predicate)
-
contains
public boolean contains(int element)
-
containsAll
public boolean containsAll(_intList elements)
-
copyTo
public <C extends _intCollecting> C copyTo(C target)
-
copyTo
public _intCollecting copyTo(_intCollecting target, _intPredicate predicate)
-
copyTo
public int[] copyTo(int[] target, int offset)
-
copyTo
public int[] copyTo(int[] target, int targetOffset, int offset, int length)
-
copySelection
public _intCollecting copySelection(_intCollecting target, long... indices)
-
shiftTo
public _intList shiftTo(int sourceIndex, int targetIndex)
-
shiftTo
public _intList shiftTo(int sourceIndex, int targetIndex, int length)
-
shiftBy
public _intList shiftBy(int sourceIndex, int distance)
-
shiftBy
public _intList shiftBy(int sourceIndex, int distance, int length)
-
swap
public _intList swap(int indexA, int indexB) throws IndexBoundsException, IndexOutOfBoundsException
-
swap
public _intList swap(int indexA, int indexB, int length)
-
reverse
public _intList reverse()
-
setFirst
public void setFirst(int element)
-
setLast
public void setLast(int element)
-
set
public _intList set(int offset, int... elements)
-
set
public _intList set(int offset, int[] src, int srcIndex, int srcLength)
-
fill
public _intList fill(int offset, int length, int element)
-
sort
public _intList sort()
-
replaceOne
public boolean replaceOne(int element, int replacement)
-
replaceOne
public boolean replaceOne(_intPredicate predicate, int substitute)
-
replace
public int replace(int element, int replacement)
-
replace
public int replace(_intPredicate predicate, int substitute)
-
replaceAll
@Deprecated public int replaceAll(_intList elements, int replacement)
Deprecated.
-
modify
public int modify(_intFunction mapper)
-
modify
public int modify(_intPredicate predicate, _intFunction mapper)
-
currentCapacity
public int currentCapacity()
-
maximumCapacity
public int maximumCapacity()
-
isFull
public boolean isFull()
-
freeCapacity
public int freeCapacity()
-
optimize
public int optimize()
-
ensureFreeCapacity
public _intList ensureFreeCapacity(int requiredFreeCapacity)
-
ensureCapacity
public _intList ensureCapacity(int minCapacity)
-
accept
public void accept(int element)
-
add
public boolean add(int element)
- Specified by:
addin interface_intCollecting
-
add
public _intList add(int... elements)
-
addAll
public _intList addAll(int[] elements, int offset, int length)
-
nullAdd
public boolean nullAdd()
-
nullPut
public boolean nullPut()
-
put
public boolean put(int element)
-
put
public _intList put(int... elements)
-
putAll
public _intList putAll(int[] elements, int offset, int length)
-
prepend
public boolean prepend(int element)
-
prepend
public _intList prepend(int... elements)
-
prependAll
public _intList prependAll(int[] elements, int offset, int length)
-
preput
public boolean preput(int element)
-
preput
public _intList preput(int... elements)
-
preputAll
public _intList preputAll(int[] elements, int offset, int length)
-
insert
public boolean insert(int index, int element)
-
insert
public int insert(int index, int... elements) throws IndexOutOfBoundsException- Throws:
IndexOutOfBoundsException
-
insertAll
public int insertAll(int index, int[] elements, int offset, int length)
-
insertAll
public int insertAll(int index, _intList elements)
-
input
public boolean input(int index, int element)
-
input
public int input(int index, int... elements) throws IndexOutOfBoundsException- Throws:
IndexOutOfBoundsException
-
inputAll
public int inputAll(int index, int[] elements, int offset, int length)
-
inputAll
public int inputAll(int index, _intList elements)
-
truncate
public void truncate()
-
consolidate
public int consolidate()
-
removeOne
public boolean removeOne(int element)
-
retrieve
public int retrieve(int element)
-
retrieve
public int retrieve(_intPredicate predicate)
-
remove
public int remove(int element)
-
removeAt
public int removeAt(int index) throws IndexOutOfBoundsException, ArrayIndexOutOfBoundsException
-
remove
public int remove(_intPredicate predicate)
-
process
public _intList process(_intProcedure procedure)
-
moveTo
public _intCollecting moveTo(_intCollecting target, _intPredicate predicate)
-
moveSelection
public _intCollecting moveSelection(_intCollecting target, long... indices)
-
removeAll
public int removeAll(_intList elements)
-
removeDuplicates
public int removeDuplicates()
-
fetch
public int fetch()
-
pop
public int pop()
-
pinch
public int pinch()
-
pick
public int pick()
-
removeSelection
public int removeSelection(int[] indices)
-
removeRange
public _intList removeRange(int startIndex, int length)
-
isEmpty
public boolean isEmpty()
-
get
public int get(int index) throws ArrayIndexOutOfBoundsException- Throws:
ArrayIndexOutOfBoundsException
-
set
public boolean set(int index, int element) throws IndexOutOfBoundsException, ArrayIndexOutOfBoundsException
-
setGet
public int setGet(int index, int element) throws IndexOutOfBoundsException, ArrayIndexOutOfBoundsException
-
size
public int size()
-
clear
public void clear()
-
-