Externalizable, Serializable, ByteIterable, MutableByteCollection, ByteList, MutableByteList, OrderedByteIterable, ReversibleByteIterable, PrimitiveIterable@NotThreadSafe public class ByteArrayList extends AbstractByteIterable implements MutableByteList, Externalizable
FastList, and is memory-optimized for byte primitives.
This file was automatically generated from template file primitiveArrayList.stg.| Constructor | Description |
|---|---|
ByteArrayList() |
|
ByteArrayList(byte... array) |
|
ByteArrayList(int initialCapacity) |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
add(byte newItem) |
|
boolean |
addAll(byte... source) |
|
boolean |
addAll(ByteIterable source) |
|
boolean |
addAllAtIndex(int index,
byte... source) |
|
boolean |
addAllAtIndex(int index,
ByteIterable source) |
|
void |
addAtIndex(int index,
byte element) |
|
boolean |
allSatisfy(BytePredicate predicate) |
Returns true if all of the elements in the ByteIterable return true for the
specified predicate, otherwise returns false.
|
boolean |
anySatisfy(BytePredicate predicate) |
Returns true if any of the elements in the ByteIterable return true for the
specified predicate, otherwise returns false.
|
void |
appendString(Appendable appendable,
String start,
String separator,
String end) |
Prints a string representation of this collection onto the given
Appendable. |
LazyByteIterable |
asReversed() |
|
MutableByteList |
asSynchronized() |
|
MutableByteList |
asUnmodifiable() |
|
int |
binarySearch(byte value) |
|
MutableByteIterator |
byteIterator() |
Returns a primitive iterator that can be used to iterate over the ByteIterable in an
imperative style.
|
void |
clear() |
|
<V> MutableList<V> |
collect(ByteToObjectFunction<? extends V> function) |
Returns a new collection with the results of applying the specified function on each element of the source
collection.
|
<V,R extends Collection<V>> |
collect(ByteToObjectFunction<? extends V> function,
R target) |
Same as
ByteIterable.collect(ByteToObjectFunction) , only the results are added to the target Collection. |
boolean |
contains(byte value) |
Returns true if the value is contained in the ByteIterable, and false if it is not.
|
int |
count(BytePredicate predicate) |
Returns a count of the number of elements in the ByteIterable that return true for the
specified predicate.
|
byte |
detectIfNone(BytePredicate predicate,
byte ifNone) |
|
MutableByteList |
distinct() |
|
long |
dotProduct(ByteList list) |
|
void |
each(ByteProcedure procedure) |
A synonym for forEach.
|
void |
ensureCapacity(int minCapacity) |
|
boolean |
equals(Object otherList) |
Follows the same general contract as
List.equals(Object). |
void |
forEach(ByteProcedure procedure) |
Applies the ByteProcedure to each element in the ByteIterable.
|
void |
forEachWithIndex(ByteIntProcedure procedure) |
|
byte |
get(int index) |
|
byte |
getFirst() |
|
byte |
getLast() |
|
int |
hashCode() |
Follows the same general contract as
List.hashCode(). |
int |
indexOf(byte value) |
|
<T> T |
injectInto(T injectedValue,
ObjectByteToObjectFunction<? super T,? extends T> function) |
|
<T> T |
injectIntoWithIndex(T injectedValue,
ObjectByteIntToObjectFunction<? super T,? extends T> function) |
|
int |
lastIndexOf(byte value) |
|
byte |
max() |
|
byte |
min() |
|
static ByteArrayList |
newList(ByteIterable source) |
|
static ByteArrayList |
newListWith(byte... elements) |
Creates a new list using the passed
elements argument as the backing store. |
static ByteArrayList |
newWithNValues(int size,
byte value) |
|
boolean |
noneSatisfy(BytePredicate predicate) |
Returns true if none of the elements in the ByteIterable return true for the
specified predicate, otherwise returns false.
|
void |
readExternal(ObjectInput in) |
|
ByteArrayList |
reject(BytePredicate predicate) |
Returns a new ByteIterable with all of the elements in the ByteIterable that
return false for the specified predicate.
|
<R extends MutableByteCollection> |
reject(BytePredicate predicate,
R target) |
Same as
ByteIterable.reject(BytePredicate) , only the results are added to the target MutableByteCollection. |
boolean |
remove(byte value) |
|
boolean |
removeAll(byte... source) |
|
boolean |
removeAll(ByteIterable source) |
|
byte |
removeAtIndex(int index) |
|
boolean |
retainAll(byte... source) |
|
boolean |
retainAll(ByteIterable source) |
|
ByteArrayList |
reverseThis() |
|
ByteArrayList |
select(BytePredicate predicate) |
Returns a new ByteIterable with all of the elements in the ByteIterable that
return true for the specified predicate.
|
<R extends MutableByteCollection> |
select(BytePredicate predicate,
R target) |
Same as
ByteIterable.select(BytePredicate) , only the results are added to the target MutableByteCollection. |
byte |
set(int index,
byte element) |
|
int |
size() |
Returns the number of items in this iterable.
|
ByteArrayList |
sortThis() |
Sorts this list mutating its contents and returns the same mutable list (this).
|
MutableByteList |
subList(int fromIndex,
int toIndex) |
|
long |
sum() |
|
byte[] |
toArray() |
Converts the ByteIterable to a primitive byte array.
|
ImmutableByteList |
toImmutable() |
Returns an immutable copy of this list.
|
ByteArrayList |
toReversed() |
|
void |
trimToSize() |
|
ByteArrayList |
with(byte element) |
|
ByteArrayList |
with(byte element1,
byte element2) |
|
ByteArrayList |
with(byte element1,
byte element2,
byte element3) |
|
ByteArrayList |
with(byte element1,
byte element2,
byte element3,
byte... elements) |
|
ByteArrayList |
withAll(ByteIterable elements) |
|
ByteArrayList |
without(byte element) |
|
ByteArrayList |
withoutAll(ByteIterable elements) |
|
void |
writeExternal(ObjectOutput out) |
asLazy, average, containsAll, containsAll, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toStringasLazy, average, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, flatCollect, maxIfEmpty, median, minIfEmpty, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedListappendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, toStringpublic ByteArrayList()
public ByteArrayList(int initialCapacity)
public ByteArrayList(byte... array)
public static ByteArrayList newListWith(byte... elements)
elements argument 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. !!!
public static ByteArrayList newList(ByteIterable source)
public static ByteArrayList newWithNValues(int size, byte value)
public int size()
PrimitiveIterablesize in interface PrimitiveIterablepublic void clear()
clear in interface MutableByteCollectionpublic boolean contains(byte value)
ByteIterablecontains in interface ByteIterablepublic byte getFirst()
getFirst in interface OrderedByteIterablepublic byte getLast()
getLast in interface ReversibleByteIterablepublic int indexOf(byte value)
indexOf in interface OrderedByteIterablepublic int lastIndexOf(byte value)
lastIndexOf in interface ByteListpublic void trimToSize()
public void ensureCapacity(int minCapacity)
public boolean add(byte newItem)
add in interface MutableByteCollectionpublic boolean addAll(byte... source)
addAll in interface MutableByteCollectionpublic boolean addAll(ByteIterable source)
addAll in interface MutableByteCollectionpublic void addAtIndex(int index,
byte element)
addAtIndex in interface MutableByteListpublic boolean addAllAtIndex(int index,
byte... source)
addAllAtIndex in interface MutableByteListpublic boolean addAllAtIndex(int index,
ByteIterable source)
addAllAtIndex in interface MutableByteListpublic boolean remove(byte value)
remove in interface MutableByteCollectionpublic boolean removeAll(ByteIterable source)
removeAll in interface MutableByteCollectionpublic boolean removeAll(byte... source)
removeAll in interface MutableByteCollectionpublic boolean retainAll(ByteIterable source)
retainAll in interface MutableByteCollectionCollection.retainAll(Collection)public boolean retainAll(byte... source)
retainAll in interface MutableByteCollectionCollection.retainAll(Collection)public byte removeAtIndex(int index)
removeAtIndex in interface MutableByteListpublic byte set(int index,
byte element)
set in interface MutableByteListpublic ByteArrayList with(byte element)
with in interface MutableByteCollectionwith in interface MutableByteListpublic ByteArrayList without(byte element)
without in interface MutableByteCollectionwithout in interface MutableByteListpublic ByteArrayList withAll(ByteIterable elements)
withAll in interface MutableByteCollectionwithAll in interface MutableByteListpublic ByteArrayList withoutAll(ByteIterable elements)
withoutAll in interface MutableByteCollectionwithoutAll in interface MutableByteListpublic ByteArrayList with(byte element1, byte element2)
public ByteArrayList with(byte element1, byte element2, byte element3)
public ByteArrayList with(byte element1, byte element2, byte element3, byte... elements)
public MutableByteIterator byteIterator()
ByteIterablebyteIterator in interface ByteIterablebyteIterator in interface MutableByteCollectionpublic void forEach(ByteProcedure procedure)
ByteIterableforEach in interface ByteIterablepublic void each(ByteProcedure procedure)
ByteIterableeach in interface ByteIterablepublic void forEachWithIndex(ByteIntProcedure procedure)
forEachWithIndex in interface OrderedByteIterablepublic <T> T injectInto(T injectedValue,
ObjectByteToObjectFunction<? super T,? extends T> function)
injectInto in interface ByteIterablepublic <T> T injectIntoWithIndex(T injectedValue,
ObjectByteIntToObjectFunction<? super T,? extends T> function)
injectIntoWithIndex in interface OrderedByteIterableinjectIntoWithIndex in interface ReversibleByteIterablepublic int count(BytePredicate predicate)
ByteIterablecount in interface ByteIterablepublic boolean anySatisfy(BytePredicate predicate)
ByteIterableanySatisfy in interface ByteIterablepublic boolean allSatisfy(BytePredicate predicate)
ByteIterableallSatisfy in interface ByteIterablepublic boolean noneSatisfy(BytePredicate predicate)
ByteIterablenoneSatisfy in interface ByteIterablepublic ByteArrayList select(BytePredicate predicate)
ByteIterableselect in interface ByteIterableselect in interface ByteListselect in interface MutableByteCollectionselect in interface MutableByteListselect in interface OrderedByteIterableselect in interface ReversibleByteIterablepublic <R extends MutableByteCollection> R select(BytePredicate predicate, R target)
ByteIterableByteIterable.select(BytePredicate) , only the results are added to the target MutableByteCollection.select in interface ByteIterablepublic ByteArrayList reject(BytePredicate predicate)
ByteIterablereject in interface ByteIterablereject in interface ByteListreject in interface MutableByteCollectionreject in interface MutableByteListreject in interface OrderedByteIterablereject in interface ReversibleByteIterablepublic <R extends MutableByteCollection> R reject(BytePredicate predicate, R target)
ByteIterableByteIterable.reject(BytePredicate) , only the results are added to the target MutableByteCollection.reject in interface ByteIterablepublic byte detectIfNone(BytePredicate predicate, byte ifNone)
detectIfNone in interface ByteIterablepublic <V> MutableList<V> collect(ByteToObjectFunction<? extends V> function)
ByteIterablecollect in interface ByteIterablecollect in interface ByteListcollect in interface MutableByteCollectioncollect in interface MutableByteListcollect in interface OrderedByteIterablecollect in interface ReversibleByteIterablepublic <V,R extends Collection<V>> R collect(ByteToObjectFunction<? extends V> function, R target)
ByteIterableByteIterable.collect(ByteToObjectFunction) , only the results are added to the target Collection.collect in interface ByteIterablepublic byte max()
max in interface ByteIterablepublic byte min()
min in interface ByteIterablepublic long sum()
sum in interface ByteIterablepublic long dotProduct(ByteList list)
dotProduct in interface ByteListpublic byte[] toArray()
ByteIterabletoArray in interface ByteIterablepublic boolean equals(Object otherList)
ByteListList.equals(Object).public int hashCode()
ByteListList.hashCode().public void appendString(Appendable appendable, String start, String separator, String end)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString(String, String, String).appendString in interface PrimitiveIterablepublic MutableByteList asUnmodifiable()
asUnmodifiable in interface MutableByteCollectionasUnmodifiable in interface MutableByteListpublic MutableByteList asSynchronized()
asSynchronized in interface MutableByteCollectionasSynchronized in interface MutableByteListpublic ImmutableByteList toImmutable()
MutableByteListtoImmutable in interface ByteListtoImmutable in interface MutableByteCollectiontoImmutable in interface MutableByteListpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException
readExternal in interface ExternalizableIOExceptionpublic LazyByteIterable asReversed()
asReversed in interface ReversibleByteIterablepublic ByteArrayList reverseThis()
reverseThis in interface MutableByteListpublic ByteArrayList sortThis()
MutableByteListsortThis in interface MutableByteListpublic ByteArrayList toReversed()
toReversed in interface ByteListtoReversed in interface MutableByteListtoReversed in interface ReversibleByteIterablepublic int binarySearch(byte value)
binarySearch in interface ByteListpublic MutableByteList distinct()
distinct in interface ByteListdistinct in interface MutableByteListdistinct in interface ReversibleByteIterablepublic MutableByteList subList(int fromIndex, int toIndex)
subList in interface ByteListsubList in interface MutableByteListCopyright © 2004–2017. All rights reserved.