Class ByteArrayList
- java.lang.Object
-
- org.eclipse.collections.impl.primitive.AbstractByteIterable
-
- org.eclipse.collections.impl.list.mutable.primitive.ByteArrayList
-
- All Implemented Interfaces:
Externalizable,Serializable,ByteIterable,MutableByteCollection,ByteList,MutableByteList,OrderedByteIterable,ReversibleByteIterable,PrimitiveIterable
public class ByteArrayList extends AbstractByteIterable implements MutableByteList, Externalizable
ByteArrayList is similar to FastList, and is memory-optimized for byte primitives. This file was automatically generated from template file primitiveArrayList.stg.- Since:
- 3.0.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ByteArrayList()ByteArrayList(byte... array)ByteArrayList(int initialCapacity)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(byte newItem)booleanaddAll(byte... source)booleanaddAll(ByteIterable source)booleanaddAllAtIndex(int index, byte... source)booleanaddAllAtIndex(int index, ByteIterable source)voidaddAtIndex(int index, byte element)booleanallSatisfy(BytePredicate predicate)booleananySatisfy(BytePredicate predicate)voidappendString(Appendable appendable, String start, String separator, String end)LazyByteIterableasReversed()MutableByteListasSynchronized()MutableByteListasUnmodifiable()intbinarySearch(byte value)MutableList<Byte>boxed()MutableByteIteratorbyteIterator()RichIterable<ByteIterable>chunk(int size)voidclear()<V> MutableList<V>collect(ByteToObjectFunction<? extends V> function)<V,R extends Collection<V>>
Rcollect(ByteToObjectFunction<? extends V> function, R target)booleancontains(byte value)intcount(BytePredicate predicate)bytedetectIfNone(BytePredicate predicate, byte ifNone)MutableByteListdistinct()longdotProduct(ByteList list)voideach(ByteProcedure procedure)voidensureCapacity(int minCapacity)booleanequals(Object otherList)voidforEachWithIndex(ByteIntProcedure procedure)byteget(int index)bytegetFirst()bytegetLast()inthashCode()intindexOf(byte value)<T> TinjectInto(T injectedValue, ObjectByteToObjectFunction<? super T,? extends T> function)<T> TinjectIntoWithIndex(T injectedValue, ObjectByteIntToObjectFunction<? super T,? extends T> function)intlastIndexOf(byte value)bytemax()bytemin()ByteArrayListnewEmpty()Creates a new empty ByteArrayList.static ByteArrayListnewList(ByteIterable source)static ByteArrayListnewListWith(byte... elements)Creates a new list using the passedelementsargument as the backing store.static ByteArrayListnewWithNValues(int size, byte value)voidreadExternal(ObjectInput in)ByteArrayListreject(BytePredicate predicate)<R extends MutableByteCollection>
Rreject(BytePredicate predicate, R target)booleanremove(byte value)booleanremoveAll(byte... source)booleanremoveAll(ByteIterable source)byteremoveAtIndex(int index)booleanremoveIf(BytePredicate predicate)booleanretainAll(byte... source)booleanretainAll(ByteIterable source)ByteArrayListreverseThis()ByteArrayListselect(BytePredicate predicate)<R extends MutableByteCollection>
Rselect(BytePredicate predicate, R target)byteset(int index, byte element)intsize()ByteArrayListsortThis()ByteArrayListsortThis(ByteComparator comparator)MutableByteListsubList(int fromIndex, int toIndex)longsum()voidswap(int index1, int index2)byte[]toArray()byte[]toArray(byte[] target)ImmutableByteListtoImmutable()ByteArrayListtoReversed()voidtrimToSize()ByteArrayListwith(byte element)ByteArrayListwith(byte element1, byte element2)ByteArrayListwith(byte element1, byte element2, byte element3)ByteArrayListwith(byte element1, byte element2, byte element3, byte... elements)ByteArrayListwithAll(ByteIterable elements)ByteArrayListwithout(byte element)ByteArrayListwithoutAll(ByteIterable elements)static ByteArrayListwrapCopy(byte... array)Creates a new list by first copying the array passed in.voidwriteExternal(ObjectOutput out)<T> MutableList<ByteObjectPair<T>>zip(Iterable<T> iterable)MutableList<ByteBytePair>zipByte(ByteIterable iterable)-
Methods inherited from class org.eclipse.collections.impl.primitive.AbstractByteIterable
asLazy, average, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toString
-
Methods inherited from interface org.eclipse.collections.api.ByteIterable
asLazy, average, averageIfEmpty, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, flatCollect, forEach, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, maxIfEmpty, median, medianIfEmpty, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListBy
-
Methods inherited from interface org.eclipse.collections.api.list.primitive.ByteList
forEachInBoth
-
Methods inherited from interface org.eclipse.collections.api.list.primitive.MutableByteList
collectWithIndex, rejectWithIndex, selectWithIndex, shuffleThis, shuffleThis, sortThisBy, sortThisBy, tap
-
Methods inherited from interface org.eclipse.collections.api.ordered.primitive.OrderedByteIterable
collectWithIndex, rejectWithIndex, selectWithIndex
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, toString
-
-
-
-
Method Detail
-
newListWith
public static ByteArrayList newListWith(byte... elements)
Creates a new list using the passedelementsargument as the backing store.!!! WARNING: This method uses the passed in array, so can be very unsafe if the original array is held onto anywhere else. !!!
-
newList
public static ByteArrayList newList(ByteIterable source)
-
newWithNValues
public static ByteArrayList newWithNValues(int size, byte value)
-
wrapCopy
public static ByteArrayList wrapCopy(byte... array)
Creates a new list by first copying the array passed in.
-
size
public int size()
- Specified by:
sizein interfacePrimitiveIterable
-
clear
public void clear()
- Specified by:
clearin interfaceMutableByteCollection
-
contains
public boolean contains(byte value)
- Specified by:
containsin interfaceByteIterable
-
getFirst
public byte getFirst()
- Specified by:
getFirstin interfaceOrderedByteIterable
-
getLast
public byte getLast()
- Specified by:
getLastin interfaceReversibleByteIterable
-
indexOf
public int indexOf(byte value)
- Specified by:
indexOfin interfaceOrderedByteIterable
-
lastIndexOf
public int lastIndexOf(byte value)
- Specified by:
lastIndexOfin interfaceByteList
-
trimToSize
public void trimToSize()
-
ensureCapacity
public void ensureCapacity(int minCapacity)
-
add
public boolean add(byte newItem)
- Specified by:
addin interfaceMutableByteCollection
-
addAll
public boolean addAll(byte... source)
- Specified by:
addAllin interfaceMutableByteCollection
-
addAll
public boolean addAll(ByteIterable source)
- Specified by:
addAllin interfaceMutableByteCollection
-
addAtIndex
public void addAtIndex(int index, byte element)- Specified by:
addAtIndexin interfaceMutableByteList
-
addAllAtIndex
public boolean addAllAtIndex(int index, byte... source)- Specified by:
addAllAtIndexin interfaceMutableByteList
-
addAllAtIndex
public boolean addAllAtIndex(int index, ByteIterable source)- Specified by:
addAllAtIndexin interfaceMutableByteList
-
remove
public boolean remove(byte value)
- Specified by:
removein interfaceMutableByteCollection
-
removeIf
public boolean removeIf(BytePredicate predicate)
- Specified by:
removeIfin interfaceMutableByteCollection
-
removeAll
public boolean removeAll(ByteIterable source)
- Specified by:
removeAllin interfaceMutableByteCollection
-
removeAll
public boolean removeAll(byte... source)
- Specified by:
removeAllin interfaceMutableByteCollection
-
retainAll
public boolean retainAll(ByteIterable source)
- Specified by:
retainAllin interfaceMutableByteCollection
-
retainAll
public boolean retainAll(byte... source)
- Specified by:
retainAllin interfaceMutableByteCollection
-
removeAtIndex
public byte removeAtIndex(int index)
- Specified by:
removeAtIndexin interfaceMutableByteList
-
set
public byte set(int index, byte element)- Specified by:
setin interfaceMutableByteList
-
swap
public void swap(int index1, int index2)- Specified by:
swapin interfaceMutableByteList
-
with
public ByteArrayList with(byte element)
- Specified by:
within interfaceMutableByteCollection- Specified by:
within interfaceMutableByteList
-
without
public ByteArrayList without(byte element)
- Specified by:
withoutin interfaceMutableByteCollection- Specified by:
withoutin interfaceMutableByteList
-
withAll
public ByteArrayList withAll(ByteIterable elements)
- Specified by:
withAllin interfaceMutableByteCollection- Specified by:
withAllin interfaceMutableByteList
-
withoutAll
public ByteArrayList withoutAll(ByteIterable elements)
- Specified by:
withoutAllin interfaceMutableByteCollection- Specified by:
withoutAllin interfaceMutableByteList
-
with
public ByteArrayList with(byte element1, byte element2)
-
with
public ByteArrayList with(byte element1, byte element2, byte element3)
-
with
public ByteArrayList with(byte element1, byte element2, byte element3, byte... elements)
-
byteIterator
public MutableByteIterator byteIterator()
- Specified by:
byteIteratorin interfaceByteIterable- Specified by:
byteIteratorin interfaceMutableByteCollection
-
each
public void each(ByteProcedure procedure)
- Specified by:
eachin interfaceByteIterable- Since:
- 7.0.
-
forEachWithIndex
public void forEachWithIndex(ByteIntProcedure procedure)
- Specified by:
forEachWithIndexin interfaceOrderedByteIterable
-
injectInto
public <T> T injectInto(T injectedValue, ObjectByteToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoin interfaceByteIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectByteIntToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoWithIndexin interfaceOrderedByteIterable- Specified by:
injectIntoWithIndexin interfaceReversibleByteIterable
-
chunk
public RichIterable<ByteIterable> chunk(int size)
- Specified by:
chunkin interfaceByteIterable
-
count
public int count(BytePredicate predicate)
- Specified by:
countin interfaceByteIterable
-
anySatisfy
public boolean anySatisfy(BytePredicate predicate)
- Specified by:
anySatisfyin interfaceByteIterable
-
allSatisfy
public boolean allSatisfy(BytePredicate predicate)
- Specified by:
allSatisfyin interfaceByteIterable
-
select
public ByteArrayList select(BytePredicate predicate)
- Specified by:
selectin interfaceByteIterable- Specified by:
selectin interfaceByteList- Specified by:
selectin interfaceMutableByteCollection- Specified by:
selectin interfaceMutableByteList- Specified by:
selectin interfaceOrderedByteIterable- Specified by:
selectin interfaceReversibleByteIterable
-
select
public <R extends MutableByteCollection> R select(BytePredicate predicate, R target)
- Specified by:
selectin interfaceByteIterable- Since:
- 8.1.
-
reject
public ByteArrayList reject(BytePredicate predicate)
- Specified by:
rejectin interfaceByteIterable- Specified by:
rejectin interfaceByteList- Specified by:
rejectin interfaceMutableByteCollection- Specified by:
rejectin interfaceMutableByteList- Specified by:
rejectin interfaceOrderedByteIterable- Specified by:
rejectin interfaceReversibleByteIterable
-
reject
public <R extends MutableByteCollection> R reject(BytePredicate predicate, R target)
- Specified by:
rejectin interfaceByteIterable- Since:
- 8.1.
-
detectIfNone
public byte detectIfNone(BytePredicate predicate, byte ifNone)
- Specified by:
detectIfNonein interfaceByteIterable
-
collect
public <V> MutableList<V> collect(ByteToObjectFunction<? extends V> function)
- Specified by:
collectin interfaceByteIterable- Specified by:
collectin interfaceByteList- Specified by:
collectin interfaceMutableByteCollection- Specified by:
collectin interfaceMutableByteList- Specified by:
collectin interfaceOrderedByteIterable- Specified by:
collectin interfaceReversibleByteIterable
-
collect
public <V,R extends Collection<V>> R collect(ByteToObjectFunction<? extends V> function, R target)
- Specified by:
collectin interfaceByteIterable- Since:
- 8.1.
-
max
public byte max()
- Specified by:
maxin interfaceByteIterable
-
min
public byte min()
- Specified by:
minin interfaceByteIterable
-
sum
public long sum()
- Specified by:
sumin interfaceByteIterable
-
dotProduct
public long dotProduct(ByteList list)
- Specified by:
dotProductin interfaceByteList
-
toArray
public byte[] toArray()
- Specified by:
toArrayin interfaceByteIterable
-
toArray
public byte[] toArray(byte[] target)
- Specified by:
toArrayin interfaceByteIterable
-
equals
public boolean equals(Object otherList)
-
hashCode
public int hashCode()
-
appendString
public void appendString(Appendable appendable, String start, String separator, String end)
- Specified by:
appendStringin interfacePrimitiveIterable
-
asUnmodifiable
public MutableByteList asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableByteCollection- Specified by:
asUnmodifiablein interfaceMutableByteList
-
asSynchronized
public MutableByteList asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableByteCollection- Specified by:
asSynchronizedin interfaceMutableByteList
-
toImmutable
public ImmutableByteList toImmutable()
- Specified by:
toImmutablein interfaceByteList- Specified by:
toImmutablein interfaceMutableByteCollection- Specified by:
toImmutablein interfaceMutableByteList
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOException
-
asReversed
public LazyByteIterable asReversed()
- Specified by:
asReversedin interfaceReversibleByteIterable
-
reverseThis
public ByteArrayList reverseThis()
- Specified by:
reverseThisin interfaceMutableByteList
-
sortThis
public ByteArrayList sortThis()
- Specified by:
sortThisin interfaceMutableByteList
-
sortThis
public ByteArrayList sortThis(ByteComparator comparator)
- Specified by:
sortThisin interfaceMutableByteList
-
toReversed
public ByteArrayList toReversed()
- Specified by:
toReversedin interfaceByteList- Specified by:
toReversedin interfaceMutableByteList- Specified by:
toReversedin interfaceReversibleByteIterable
-
binarySearch
public int binarySearch(byte value)
- Specified by:
binarySearchin interfaceByteList
-
distinct
public MutableByteList distinct()
- Specified by:
distinctin interfaceByteList- Specified by:
distinctin interfaceMutableByteList- Specified by:
distinctin interfaceReversibleByteIterable
-
subList
public MutableByteList subList(int fromIndex, int toIndex)
- Specified by:
subListin interfaceByteList- Specified by:
subListin interfaceMutableByteList
-
zipByte
public MutableList<ByteBytePair> zipByte(ByteIterable iterable)
- Specified by:
zipBytein interfaceByteList- Specified by:
zipBytein interfaceMutableByteList- Since:
- 9.1.
-
newEmpty
public ByteArrayList newEmpty()
Creates a new empty ByteArrayList.- Specified by:
newEmptyin interfaceMutableByteCollection- Specified by:
newEmptyin interfaceMutableByteList- Since:
- 9.2.
-
zip
public <T> MutableList<ByteObjectPair<T>> zip(Iterable<T> iterable)
- Specified by:
zipin interfaceByteList- Specified by:
zipin interfaceMutableByteList- Since:
- 9.1.
-
boxed
public MutableList<Byte> boxed()
- Specified by:
boxedin interfaceMutableByteList
-
-