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 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:
-
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
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
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 Details
-
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:
add
in 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()
-