Class ImmutableByteSingletonList
- java.lang.Object
-
- org.eclipse.collections.impl.list.immutable.primitive.ImmutableByteSingletonList
-
- All Implemented Interfaces:
java.io.Serializable,ByteIterable,ImmutableByteCollection,ByteList,ImmutableByteList,OrderedByteIterable,ReversibleByteIterable,PrimitiveIterable
final class ImmutableByteSingletonList extends java.lang.Object implements ImmutableByteList, java.io.Serializable
ImmutableByteSingletonList is an optimization forImmutableByteListof size 1. This file was automatically generated from template file immutablePrimitiveSingletonList.stg.
-
-
Field Summary
Fields Modifier and Type Field Description private byteelement1private static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description ImmutableByteSingletonList(byte element)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallSatisfy(BytePredicate predicate)Returns true if all of the elements in the ByteIterable return true for the specified predicate, otherwise returns false.booleananySatisfy(BytePredicate predicate)Returns true if any of the elements in the ByteIterable return true for the specified predicate, otherwise returns false.voidappendString(java.lang.Appendable appendable)Prints a string representation of this collection onto the givenAppendable.voidappendString(java.lang.Appendable appendable, java.lang.String separator)Prints a string representation of this collection onto the givenAppendable.voidappendString(java.lang.Appendable appendable, java.lang.String start, java.lang.String separator, java.lang.String end)Prints a string representation of this collection onto the givenAppendable.LazyByteIterableasLazy()Returns a LazyByteIterable adapter wrapping the source ByteIterable.LazyByteIterableasReversed()doubleaverage()intbinarySearch(byte value)ByteIteratorbyteIterator()Returns a primitive iterator that can be used to iterate over the ByteIterable in an imperative style.RichIterable<ByteIterable>chunk(int size)Partitions elements in fixed size chunks.<V> ImmutableList<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.booleancontains(byte value)Returns true if the value is contained in the ByteIterable, and false if it is not.booleancontainsAll(byte... source)Returns true if all of the values specified in the source array are contained in the ByteIterable, and false if they are not.booleancontainsAll(ByteIterable source)Returns true if all of the values specified in the source ByteIterable are contained in the ByteIterable, and false if they are not.intcount(BytePredicate predicate)Returns a count of the number of elements in the ByteIterable that return true for the specified predicate.bytedetectIfNone(BytePredicate predicate, byte ifNone)ImmutableByteListdistinct()longdotProduct(ByteList list)voideach(ByteProcedure procedure)A synonym for forEach.booleanequals(java.lang.Object otherList)Follows the same general contract asList.equals(Object).voidforEachWithIndex(ByteIntProcedure procedure)byteget(int index)bytegetFirst()bytegetLast()inthashCode()Follows the same general contract asList.hashCode().intindexOf(byte value)<T> TinjectInto(T injectedValue, ObjectByteToObjectFunction<? super T,? extends T> function)<T> TinjectIntoWithIndex(T injectedValue, ObjectByteIntToObjectFunction<? super T,? extends T> function)booleanisEmpty()Returns true if this iterable has zero items.intlastIndexOf(byte value)java.lang.StringmakeString()Returns a string representation of this collection by delegating toPrimitiveIterable.makeString(String)and defaulting the separator parameter to the characters", "(comma and space).java.lang.StringmakeString(java.lang.String separator)Returns a string representation of this collection by delegating toPrimitiveIterable.makeString(String, String, String)and defaulting the start and end parameters to""(the empty String).java.lang.StringmakeString(java.lang.String start, java.lang.String separator, java.lang.String end)Returns a string representation of this collection with the elements separated by the specified separator and enclosed between the start and end strings.bytemax()bytemaxIfEmpty(byte defaultValue)doublemedian()bytemin()byteminIfEmpty(byte defaultValue)ImmutableByteListnewWith(byte element)ImmutableByteListnewWithAll(ByteIterable elements)ImmutableByteListnewWithout(byte element)ImmutableByteListnewWithoutAll(ByteIterable elements)booleannoneSatisfy(BytePredicate predicate)Returns true if none of the elements in the ByteIterable return true for the specified predicate, otherwise returns false.booleannotEmpty()The English equivalent of !this.isEmpty()ImmutableByteListreject(BytePredicate predicate)Returns a new ByteIterable with all of the elements in the ByteIterable that return false for the specified predicate.ImmutableByteListselect(BytePredicate predicate)Returns a new ByteIterable with all of the elements in the ByteIterable that return true for the specified predicate.intsize()Returns the number of items in this iterable.ImmutableByteListsubList(int fromIndex, int toIndex)longsum()byte[]toArray()Converts the ByteIterable to a primitive byte array.byte[]toArray(byte[] target)Converts the ByteIterable to a primitive byte array.MutableByteBagtoBag()Converts the ByteIterable to a new MutableByteBag.ImmutableByteListtoImmutable()Returns an immutable copy of this list.MutableByteListtoList()Converts the ByteIterable to a new MutableByteList.ImmutableByteSingletonListtoReversed()MutableByteSettoSet()Converts the ByteIterable to a new MutableByteSet.byte[]toSortedArray()MutableByteListtoSortedList()MutableByteStacktoStack()Converts the collection to a ByteStack.java.lang.StringtoString()Returns a string with the elements of this iterable separated by commas with spaces and enclosed in square brackets.<T> ImmutableList<ByteObjectPair<T>>zip(java.lang.Iterable<T> iterable)Returns anImmutableListformed from thisImmutableByteListand aListIterableby combining corresponding elements in pairs.ImmutableList<ByteBytePair>zipByte(ByteIterable iterable)Returns anImmutableListformed from thisImmutableByteListand anotherByteListby combining corresponding elements in pairs.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.collections.api.ByteIterable
averageIfEmpty, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAny, containsAny, containsNone, containsNone, flatCollect, forEach, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, medianIfEmpty, reduce, reduceIfEmpty, reject, select, summaryStatistics, 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.ImmutableByteList
collectWithIndex, rejectWithIndex, selectWithIndex, tap
-
Methods inherited from interface org.eclipse.collections.api.ordered.primitive.OrderedByteIterable
collectWithIndex, rejectWithIndex, selectWithIndex
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
element1
private final byte element1
-
-
Method Detail
-
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
-
byteIterator
public ByteIterator byteIterator()
Description copied from interface:ByteIterableReturns a primitive iterator that can be used to iterate over the ByteIterable in an imperative style.- Specified by:
byteIteratorin interfaceByteIterable
-
each
public void each(ByteProcedure procedure)
Description copied from interface:ByteIterableA synonym for forEach.- Specified by:
eachin interfaceByteIterable- Since:
- 7.0.
-
forEachWithIndex
public void forEachWithIndex(ByteIntProcedure procedure)
- Specified by:
forEachWithIndexin interfaceOrderedByteIterable
-
count
public int count(BytePredicate predicate)
Description copied from interface:ByteIterableReturns a count of the number of elements in the ByteIterable that return true for the specified predicate.- Specified by:
countin interfaceByteIterable
-
anySatisfy
public boolean anySatisfy(BytePredicate predicate)
Description copied from interface:ByteIterableReturns true if any of the elements in the ByteIterable return true for the specified predicate, otherwise returns false.- Specified by:
anySatisfyin interfaceByteIterable
-
allSatisfy
public boolean allSatisfy(BytePredicate predicate)
Description copied from interface:ByteIterableReturns true if all of the elements in the ByteIterable return true for the specified predicate, otherwise returns false.- Specified by:
allSatisfyin interfaceByteIterable
-
noneSatisfy
public boolean noneSatisfy(BytePredicate predicate)
Description copied from interface:ByteIterableReturns true if none of the elements in the ByteIterable return true for the specified predicate, otherwise returns false.- Specified by:
noneSatisfyin interfaceByteIterable
-
select
public ImmutableByteList select(BytePredicate predicate)
Description copied from interface:ByteIterableReturns a new ByteIterable with all of the elements in the ByteIterable that return true for the specified predicate.- Specified by:
selectin interfaceByteIterable- Specified by:
selectin interfaceByteList- Specified by:
selectin interfaceImmutableByteCollection- Specified by:
selectin interfaceImmutableByteList- Specified by:
selectin interfaceOrderedByteIterable- Specified by:
selectin interfaceReversibleByteIterable
-
reject
public ImmutableByteList reject(BytePredicate predicate)
Description copied from interface:ByteIterableReturns a new ByteIterable with all of the elements in the ByteIterable that return false for the specified predicate.- Specified by:
rejectin interfaceByteIterable- Specified by:
rejectin interfaceByteList- Specified by:
rejectin interfaceImmutableByteCollection- Specified by:
rejectin interfaceImmutableByteList- Specified by:
rejectin interfaceOrderedByteIterable- Specified by:
rejectin interfaceReversibleByteIterable
-
detectIfNone
public byte detectIfNone(BytePredicate predicate, byte ifNone)
- Specified by:
detectIfNonein interfaceByteIterable
-
collect
public <V> ImmutableList<V> collect(ByteToObjectFunction<? extends V> function)
Description copied from interface:ByteIterableReturns a new collection with the results of applying the specified function on each element of the source collection. This method is also commonly called transform or map.- Specified by:
collectin interfaceByteIterable- Specified by:
collectin interfaceByteList- Specified by:
collectin interfaceImmutableByteCollection- Specified by:
collectin interfaceImmutableByteList- Specified by:
collectin interfaceOrderedByteIterable- Specified by:
collectin interfaceReversibleByteIterable
-
sum
public long sum()
- Specified by:
sumin interfaceByteIterable
-
max
public byte max()
- Specified by:
maxin interfaceByteIterable
-
maxIfEmpty
public byte maxIfEmpty(byte defaultValue)
- Specified by:
maxIfEmptyin interfaceByteIterable
-
min
public byte min()
- Specified by:
minin interfaceByteIterable
-
minIfEmpty
public byte minIfEmpty(byte defaultValue)
- Specified by:
minIfEmptyin interfaceByteIterable
-
average
public double average()
- Specified by:
averagein interfaceByteIterable
-
median
public double median()
- Specified by:
medianin interfaceByteIterable
-
toSortedArray
public byte[] toSortedArray()
- Specified by:
toSortedArrayin interfaceByteIterable
-
toSortedList
public MutableByteList toSortedList()
- Specified by:
toSortedListin interfaceByteIterable
-
binarySearch
public int binarySearch(byte value)
- Specified by:
binarySearchin interfaceByteList
-
dotProduct
public long dotProduct(ByteList list)
- Specified by:
dotProductin interfaceByteList
-
toArray
public byte[] toArray()
Description copied from interface:ByteIterableConverts the ByteIterable to a primitive byte array.- Specified by:
toArrayin interfaceByteIterable
-
toArray
public byte[] toArray(byte[] target)
Description copied from interface:ByteIterableConverts the ByteIterable to a primitive byte array. If the collection fits into the provided array it is used to store its elements and is returned from the method, otherwise a new array of the appropriate size is allocated and returned. If the iterable is empty, the target array is returned unchanged.- Specified by:
toArrayin interfaceByteIterable
-
contains
public boolean contains(byte value)
Description copied from interface:ByteIterableReturns true if the value is contained in the ByteIterable, and false if it is not.- Specified by:
containsin interfaceByteIterable
-
containsAll
public boolean containsAll(byte... source)
Description copied from interface:ByteIterableReturns true if all of the values specified in the source array are contained in the ByteIterable, and false if they are not.- Specified by:
containsAllin interfaceByteIterable
-
containsAll
public boolean containsAll(ByteIterable source)
Description copied from interface:ByteIterableReturns true if all of the values specified in the source ByteIterable are contained in the ByteIterable, and false if they are not.- Specified by:
containsAllin interfaceByteIterable
-
asReversed
public LazyByteIterable asReversed()
- Specified by:
asReversedin interfaceReversibleByteIterable
-
toList
public MutableByteList toList()
Description copied from interface:ByteIterableConverts the ByteIterable to a new MutableByteList.- Specified by:
toListin interfaceByteIterable
-
toSet
public MutableByteSet toSet()
Description copied from interface:ByteIterableConverts the ByteIterable to a new MutableByteSet.- Specified by:
toSetin interfaceByteIterable
-
toBag
public MutableByteBag toBag()
Description copied from interface:ByteIterableConverts the ByteIterable to a new MutableByteBag.- Specified by:
toBagin interfaceByteIterable
-
asLazy
public LazyByteIterable asLazy()
Description copied from interface:ByteIterableReturns a LazyByteIterable adapter wrapping the source ByteIterable.- Specified by:
asLazyin interfaceByteIterable
-
toImmutable
public ImmutableByteList toImmutable()
Description copied from interface:ByteListReturns an immutable copy of this list. If the list is immutable, it returns itself.- Specified by:
toImmutablein interfaceByteList
-
toReversed
public ImmutableByteSingletonList toReversed()
- Specified by:
toReversedin interfaceByteList- Specified by:
toReversedin interfaceImmutableByteList- Specified by:
toReversedin interfaceReversibleByteIterable
-
newWith
public ImmutableByteList newWith(byte element)
- Specified by:
newWithin interfaceImmutableByteCollection- Specified by:
newWithin interfaceImmutableByteList
-
newWithout
public ImmutableByteList newWithout(byte element)
- Specified by:
newWithoutin interfaceImmutableByteCollection- Specified by:
newWithoutin interfaceImmutableByteList
-
newWithAll
public ImmutableByteList newWithAll(ByteIterable elements)
- Specified by:
newWithAllin interfaceImmutableByteCollection- Specified by:
newWithAllin interfaceImmutableByteList
-
newWithoutAll
public ImmutableByteList newWithoutAll(ByteIterable elements)
- Specified by:
newWithoutAllin interfaceImmutableByteCollection- Specified by:
newWithoutAllin interfaceImmutableByteList
-
size
public int size()
Description copied from interface:PrimitiveIterableReturns the number of items in this iterable.- Specified by:
sizein interfacePrimitiveIterable
-
isEmpty
public boolean isEmpty()
Description copied from interface:PrimitiveIterableReturns true if this iterable has zero items.- Specified by:
isEmptyin interfacePrimitiveIterable
-
notEmpty
public boolean notEmpty()
Description copied from interface:PrimitiveIterableThe English equivalent of !this.isEmpty()- Specified by:
notEmptyin interfacePrimitiveIterable
-
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)
Description copied from interface:ByteIterablePartitions elements in fixed size chunks.- Specified by:
chunkin interfaceByteIterable- Parameters:
size- the number of elements per chunk- Returns:
- A
RichIterablecontainingByteIterables of sizesize, except the last will be truncated if the elements don't divide evenly.
-
equals
public boolean equals(java.lang.Object otherList)
Description copied from interface:ByteListFollows the same general contract asList.equals(Object).
-
hashCode
public int hashCode()
Description copied from interface:ByteListFollows the same general contract asList.hashCode().
-
toString
public java.lang.String toString()
Description copied from interface:PrimitiveIterableReturns a string with the elements of this iterable separated by commas with spaces and enclosed in square brackets.Assert.assertEquals("[]", IntLists.mutable.empty().toString()); Assert.assertEquals("[1]", IntLists.mutable.with(1).toString()); Assert.assertEquals("[1, 2, 3]", IntLists.mutable.with(1, 2, 3).toString());- Specified by:
toStringin interfacePrimitiveIterable- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of this PrimitiveIterable
- See Also:
AbstractCollection.toString()
-
makeString
public java.lang.String makeString()
Description copied from interface:PrimitiveIterableReturns a string representation of this collection by delegating toPrimitiveIterable.makeString(String)and defaulting the separator parameter to the characters", "(comma and space).- Specified by:
makeStringin interfacePrimitiveIterable- Returns:
- a string representation of this collection.
-
makeString
public java.lang.String makeString(java.lang.String separator)
Description copied from interface:PrimitiveIterableReturns a string representation of this collection by delegating toPrimitiveIterable.makeString(String, String, String)and defaulting the start and end parameters to""(the empty String).- Specified by:
makeStringin interfacePrimitiveIterable- Returns:
- a string representation of this collection.
-
makeString
public java.lang.String makeString(java.lang.String start, java.lang.String separator, java.lang.String end)Description copied from interface:PrimitiveIterableReturns a string representation of this collection with the elements separated by the specified separator and enclosed between the start and end strings.- Specified by:
makeStringin interfacePrimitiveIterable- Returns:
- a string representation of this collection.
-
appendString
public void appendString(java.lang.Appendable appendable)
Description copied from interface:PrimitiveIterablePrints a string representation of this collection onto the givenAppendable. Prints the string returned byPrimitiveIterable.makeString().- Specified by:
appendStringin interfacePrimitiveIterable
-
appendString
public void appendString(java.lang.Appendable appendable, java.lang.String separator)Description copied from interface:PrimitiveIterablePrints a string representation of this collection onto the givenAppendable. Prints the string returned byPrimitiveIterable.makeString(String).- Specified by:
appendStringin interfacePrimitiveIterable
-
appendString
public void appendString(java.lang.Appendable appendable, java.lang.String start, java.lang.String separator, java.lang.String end)Description copied from interface:PrimitiveIterablePrints a string representation of this collection onto the givenAppendable. Prints the string returned byPrimitiveIterable.makeString(String, String, String).- Specified by:
appendStringin interfacePrimitiveIterable
-
distinct
public ImmutableByteList distinct()
- Specified by:
distinctin interfaceByteList- Specified by:
distinctin interfaceImmutableByteList- Specified by:
distinctin interfaceReversibleByteIterable- Since:
- 6.0.
-
subList
public ImmutableByteList subList(int fromIndex, int toIndex)
- Specified by:
subListin interfaceByteList- Specified by:
subListin interfaceImmutableByteList- See Also:
List.subList(int fromIndex, int toIndex)
-
zipByte
public ImmutableList<ByteBytePair> zipByte(ByteIterable iterable)
Description copied from interface:ImmutableByteListReturns anImmutableListformed from thisImmutableByteListand anotherByteListby combining corresponding elements in pairs. If one of the twoByteLists is longer than the other, its remaining elements are ignored.- Specified by:
zipBytein interfaceByteList- Specified by:
zipBytein interfaceImmutableByteList- Since:
- 9.1.
-
zip
public <T> ImmutableList<ByteObjectPair<T>> zip(java.lang.Iterable<T> iterable)
Description copied from interface:ImmutableByteListReturns anImmutableListformed from thisImmutableByteListand aListIterableby combining corresponding elements in pairs. If one of the two Lists is longer than the other, its remaining elements are ignored.- Specified by:
zipin interfaceByteList- Specified by:
zipin interfaceImmutableByteList- Since:
- 9.1.
-
toStack
public MutableByteStack toStack()
Description copied from interface:OrderedByteIterableConverts the collection to a ByteStack.- Specified by:
toStackin interfaceOrderedByteIterable
-
-