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 void
accept(int element)
boolean
add(int element)
_intList
add(int... elements)
_intList
addAll(int[] elements, int offset, int length)
_intList
addAll(_intList elements)
boolean
applies(_intPredicate predicate)
void
clear()
int
consolidate()
boolean
contains(int element)
boolean
containsAll(_intList elements)
boolean
containsSearched(_intPredicate predicate)
_intList
copy()
_intCollecting
copySelection(_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)
_intCollecting
copyTo(_intCollecting target, _intPredicate predicate)
int
count(int element)
int
count(_intPredicate predicate)
int
currentCapacity()
_intList
ensureCapacity(int minCapacity)
_intList
ensureFreeCapacity(int requiredFreeCapacity)
int
fetch()
_intList
fill(int offset, int length, int element)
int
first()
int
freeCapacity()
int
get(int index)
boolean
hasVolatileElements()
int
indexOf(int element)
int
indexOf(_intPredicate predicate)
boolean
input(int index, int element)
int
input(int index, int... elements)
int
inputAll(int index, int[] elements, int offset, int length)
int
inputAll(int index, _intList elements)
boolean
insert(int index, int element)
int
insert(int index, int... elements)
int
insertAll(int index, int[] elements, int offset, int length)
int
insertAll(int index, _intList elements)
boolean
isEmpty()
boolean
isFull()
boolean
isSorted(boolean ascending)
_intList
iterate(_intIndexProcedure procedure)
_intList
iterate(_intProcedure procedure)
int
last()
int
lastIndexOf(int element)
int
lastIndexOf(_intPredicate predicate)
int
max()
int
maximumCapacity()
int
min()
int
modify(_intFunction mapper)
int
modify(_intPredicate predicate, _intFunction mapper)
_intCollecting
moveSelection(_intCollecting target, long... indices)
_intCollecting
moveTo(_intCollecting target, _intPredicate predicate)
boolean
nullAdd()
boolean
nullAllowed()
boolean
nullPut()
int
optimize()
int
pick()
int
pinch()
int
pop()
boolean
prepend(int element)
_intList
prepend(int... elements)
_intList
prependAll(int[] elements, int offset, int length)
_intList
prependAll(_intList elements)
boolean
preput(int element)
_intList
preput(int... elements)
_intList
preputAll(int[] elements, int offset, int length)
_intList
preputAll(_intList elements)
_intList
process(_intProcedure procedure)
boolean
put(int element)
_intList
put(int... elements)
_intList
putAll(int[] elements, int offset, int length)
_intList
putAll(_intList elements)
int
remove(int element)
int
remove(_intPredicate predicate)
int
removeAll(_intList elements)
int
removeAt(int index)
int
removeDuplicates()
boolean
removeOne(int element)
_intList
removeRange(int startIndex, int length)
int
removeSelection(int[] indices)
int
replace(int element, int replacement)
int
replace(_intPredicate predicate, int substitute)
int
replaceAll(_intList elements, int replacement)
Deprecated.boolean
replaceOne(int element, int replacement)
boolean
replaceOne(_intPredicate predicate, int substitute)
int
retrieve(int element)
int
retrieve(_intPredicate predicate)
_intList
reverse()
int
scan(_intPredicate predicate)
int
search(_intPredicate predicate)
boolean
set(int index, int element)
_intList
set(int offset, int... elements)
_intList
set(int offset, int[] src, int srcIndex, int srcLength)
void
setFirst(int element)
int
setGet(int index, int element)
void
setLast(int element)
_intList
shiftBy(int sourceIndex, int distance)
_intList
shiftBy(int sourceIndex, int distance, int length)
_intList
shiftTo(int sourceIndex, int targetIndex)
_intList
shiftTo(int sourceIndex, int targetIndex, int length)
int
size()
_intList
sort()
_intList
swap(int indexA, int indexB)
_intList
swap(int indexA, int indexB, int length)
int[]
toArray()
_intList
toReversed()
String
toString()
void
truncate()
-
-
-
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:
-
Integer
MAX_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
- ifnull
was passed.- See Also:
copy()
-
_intList
public _intList(int... elements) throws NullPointerException
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 annull
array reference will cause aNullPointerException
.- Parameters:
elements
- the initial elements for the new instance.- Throws:
NullPointerException
- if an explicitnull
array 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
initialCapacity
andsrcLength
as 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:
add
in 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()
-
-