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)protected intinternalCountingAddAll(int[] elements)protected intinternalCountingAddAll(int[] elements, int offset, int length)protected intinternalCountingAddAll(_intList elements)protected intinternalCountingPutAll(int[] elements)protected intinternalCountingPutAll(int[] elements, int offset, int length)protected intinternalCountingPutAll(_intList elements)protected int[]internalGetSectionIndices()protected int[]internalGetStorageArray()protected intinternalSize()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 Details
-
_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
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
Convenience 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 Details
-
internalGetStorageArray
protected int[] internalGetStorageArray() -
internalSize
protected int internalSize() -
internalGetSectionIndices
protected int[] internalGetSectionIndices() -
internalCountingAddAll
- Throws:
UnsupportedOperationException
-
internalCountingAddAll
protected int internalCountingAddAll(int[] elements, int offset, int length) throws UnsupportedOperationException- Throws:
UnsupportedOperationException
-
internalCountingAddAll
- Throws:
UnsupportedOperationException
-
internalCountingPutAll
- Throws:
UnsupportedOperationException
-
internalCountingPutAll
protected int internalCountingPutAll(int[] elements, int offset, int length) throws UnsupportedOperationException- Throws:
UnsupportedOperationException
-
internalCountingPutAll
- Throws:
UnsupportedOperationException
-
copy
-
toReversed
-
toArray
public int[] toArray() -
iterate
-
iterate
-
count
public int count(int element) -
count
-
indexOf
public int indexOf(int element) -
indexOf
-
lastIndexOf
public int lastIndexOf(int element) -
lastIndexOf
-
scan
-
first
public int first() -
last
public int last() -
search
-
max
public int max() -
min
public int min() -
hasVolatileElements
public boolean hasVolatileElements() -
nullAllowed
public boolean nullAllowed() -
isSorted
public boolean isSorted(boolean ascending) -
containsSearched
-
applies
-
contains
public boolean contains(int element) -
containsAll
-
copyTo
-
copyTo
-
copyTo
public int[] copyTo(int[] target, int offset) -
copyTo
public int[] copyTo(int[] target, int targetOffset, int offset, int length) -
copySelection
-
shiftTo
-
shiftTo
-
shiftBy
-
shiftBy
-
swap
public _intList swap(int indexA, int indexB) throws IndexBoundsException, IndexOutOfBoundsException -
swap
-
reverse
-
setFirst
public void setFirst(int element) -
setLast
public void setLast(int element) -
set
-
set
-
fill
-
sort
-
replaceOne
public boolean replaceOne(int element, int replacement) -
replaceOne
-
replace
public int replace(int element, int replacement) -
replace
-
replaceAll
Deprecated. -
modify
-
modify
-
currentCapacity
public int currentCapacity() -
maximumCapacity
public int maximumCapacity() -
isFull
public boolean isFull() -
freeCapacity
public int freeCapacity() -
optimize
public int optimize() -
ensureFreeCapacity
-
ensureCapacity
-
accept
public void accept(int element) -
add
public boolean add(int element)- Specified by:
addin interface_intCollecting
-
add
-
addAll
-
addAll
-
nullAdd
public boolean nullAdd() -
nullPut
public boolean nullPut() -
put
public boolean put(int element) -
put
-
putAll
-
putAll
-
prepend
public boolean prepend(int element) -
prepend
-
prependAll
-
prependAll
-
preput
public boolean preput(int element) -
preput
-
preputAll
-
preputAll
-
insert
public boolean insert(int index, int element) -
insert
- Throws:
IndexOutOfBoundsException
-
insertAll
public int insertAll(int index, int[] elements, int offset, int length) -
insertAll
-
input
public boolean input(int index, int element) -
input
- Throws:
IndexOutOfBoundsException
-
inputAll
public int inputAll(int index, int[] elements, int offset, int length) -
inputAll
-
truncate
public void truncate() -
consolidate
public int consolidate() -
removeOne
public boolean removeOne(int element) -
retrieve
public int retrieve(int element) -
retrieve
-
remove
public int remove(int element) -
removeAt
-
remove
-
process
-
moveTo
-
moveSelection
-
removeAll
-
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
-
isEmpty
public boolean isEmpty() -
get
- 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() -
toString
-
clear
public void clear()
-