Serializable
, FloatIterable
, OrderedFloatIterable
, PrimitiveIterable
, FloatStack
, MutableFloatStack
public class SynchronizedFloatStack extends Object implements MutableFloatStack, Serializable
MutableFloatStack
. It is imperative that the user manually synchronize on the collection when iterating over it using the
FloatIterator
, as per Collections.synchronizedCollection(Collection)
.
This file was automatically generated from template file synchronizedPrimitiveStack.stg.
MutableFloatStack.asSynchronized()
,
MutableStack.asSynchronized()
,
Serialized FormConstructor | Description |
---|---|
SynchronizedFloatStack(MutableFloatStack stack) |
|
SynchronizedFloatStack(MutableFloatStack stack,
Object newLock) |
Modifier and Type | Method | Description |
---|---|---|
boolean |
allSatisfy(FloatPredicate predicate) |
Returns true if all of the elements in the FloatIterable return true for the
specified predicate, otherwise returns false.
|
boolean |
anySatisfy(FloatPredicate predicate) |
Returns true if any of the elements in the FloatIterable return true for the
specified predicate, otherwise returns false.
|
void |
appendString(Appendable appendable) |
Prints a string representation of this collection onto the given
Appendable . |
void |
appendString(Appendable appendable,
String separator) |
Prints a string representation of this collection onto the given
Appendable . |
void |
appendString(Appendable appendable,
String start,
String separator,
String end) |
Prints a string representation of this collection onto the given
Appendable . |
LazyFloatIterable |
asLazy() |
Returns a LazyFloatIterable adapter wrapping the source FloatIterable.
|
MutableFloatStack |
asSynchronized() |
|
MutableFloatStack |
asUnmodifiable() |
|
double |
average() |
|
RichIterable<FloatIterable> |
chunk(int size) |
Partitions elements in fixed size chunks.
|
void |
clear() |
Clears the Stack
|
<V> MutableStack<V> |
collect(FloatToObjectFunction<? extends V> function) |
Returns a new collection with the results of applying the specified function on each element of the source
collection.
|
<V> MutableStack<V> |
collectWithIndex(FloatIntToObjectFunction<? extends V> function) |
Returns a new MutableStack using results obtained by applying the specified function to each element
and its corresponding index.
|
<V,R extends Collection<V>> |
collectWithIndex(FloatIntToObjectFunction<? extends V> function,
R target) |
Adds elements to the target Collection using results obtained by applying the specified function to each element
and its corresponding index.
|
boolean |
contains(float value) |
Returns true if the value is contained in the FloatIterable, and false if it is not.
|
boolean |
containsAll(float... source) |
Returns true if the all of the values specified in the source array are contained
in the FloatIterable, and false if they are not.
|
boolean |
containsAll(FloatIterable source) |
Returns true if the all of the values specified in the source FloatIterable are contained
in the FloatIterable, and false if they are not.
|
int |
count(FloatPredicate predicate) |
Returns a count of the number of elements in the FloatIterable that return true for the
specified predicate.
|
float |
detectIfNone(FloatPredicate predicate,
float ifNone) |
|
void |
each(FloatProcedure procedure) |
A synonym for forEach.
|
boolean |
equals(Object otherStack) |
Follows the same general contract as
StackIterable.equals(Object) . |
FloatIterator |
floatIterator() |
Must be called in a synchronized block.
|
void |
forEach(FloatProcedure procedure) |
Applies the FloatProcedure to each element in the FloatIterable.
|
void |
forEachWithIndex(FloatIntProcedure procedure) |
|
float |
getFirst() |
|
int |
hashCode() |
Follows the same general contract as
StackIterable.hashCode() . |
int |
indexOf(float value) |
|
<T> T |
injectInto(T injectedValue,
ObjectFloatToObjectFunction<? super T,? extends T> function) |
|
<T> T |
injectIntoWithIndex(T injectedValue,
ObjectFloatIntToObjectFunction<? super T,? extends T> function) |
|
boolean |
isEmpty() |
Returns true if this iterable has zero items.
|
String |
makeString() |
Returns a string representation of this collection by delegating to
PrimitiveIterable.makeString(String) and defaulting
the separator parameter to the characters ", " (comma and space). |
String |
makeString(String separator) |
Returns a string representation of this collection by delegating to
PrimitiveIterable.makeString(String, String, String)
and defaulting the start and end parameters to "" (the empty String). |
String |
makeString(String start,
String separator,
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.
|
float |
max() |
|
float |
maxIfEmpty(float defaultValue) |
|
double |
median() |
|
float |
min() |
|
float |
minIfEmpty(float defaultValue) |
|
MutableFloatStack |
newEmpty() |
Creates a new empty mutable version of the same stack type.
|
boolean |
noneSatisfy(FloatPredicate predicate) |
Returns true if none of the elements in the FloatIterable return true for the
specified predicate, otherwise returns false.
|
boolean |
notEmpty() |
The English equivalent of !this.isEmpty()
|
float |
peek() |
Returns the top of the stack.
|
FloatList |
peek(int count) |
Returns FloatList of the number of elements specified by the count, beginning with the top of the stack.
|
float |
peekAt(int index) |
Returns the element at the specified index.
|
float |
pop() |
Removes and returns the top element of the stack.
|
FloatList |
pop(int count) |
Removes and returns a FloatList of the number of elements specified by the count, beginning with the top of the stack.
|
void |
push(float item) |
Adds an item to the top of the stack.
|
MutableFloatStack |
reject(FloatPredicate predicate) |
Returns a new FloatIterable with all of the elements in the FloatIterable that
return false for the specified predicate.
|
MutableFloatStack |
select(FloatPredicate predicate) |
Returns a new FloatIterable with all of the elements in the FloatIterable that
return true for the specified predicate.
|
int |
size() |
Returns the number of items in this iterable.
|
double |
sum() |
|
float[] |
toArray() |
Converts the FloatIterable to a primitive float array.
|
MutableFloatBag |
toBag() |
Converts the FloatIterable to a new MutableFloatBag.
|
ImmutableFloatStack |
toImmutable() |
|
MutableFloatList |
toList() |
Converts the FloatIterable to a new MutableFloatList.
|
MutableFloatSet |
toSet() |
Converts the FloatIterable to a new MutableFloatSet.
|
float[] |
toSortedArray() |
|
MutableFloatList |
toSortedList() |
|
String |
toString() |
Returns a string with the elements of this iterable separated by commas with spaces and
enclosed in square brackets.
|
averageIfEmpty, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, flatCollect, medianIfEmpty, reduce, reduceIfEmpty, reject, select, summaryStatistics
tap
public SynchronizedFloatStack(MutableFloatStack stack)
public SynchronizedFloatStack(MutableFloatStack stack, Object newLock)
public void push(float item)
MutableFloatStack
push
in interface MutableFloatStack
public float pop()
MutableFloatStack
pop
in interface MutableFloatStack
public FloatList pop(int count)
MutableFloatStack
pop
in interface MutableFloatStack
public float peek()
FloatStack
peek
in interface FloatStack
public FloatList peek(int count)
FloatStack
peek
in interface FloatStack
public float peekAt(int index)
FloatStack
peekAt
in interface FloatStack
index
- the location to peek intopublic int size()
PrimitiveIterable
size
in interface PrimitiveIterable
public boolean isEmpty()
PrimitiveIterable
isEmpty
in interface PrimitiveIterable
public boolean notEmpty()
PrimitiveIterable
notEmpty
in interface PrimitiveIterable
public void clear()
MutableFloatStack
clear
in interface MutableFloatStack
public boolean contains(float value)
FloatIterable
contains
in interface FloatIterable
public boolean containsAll(float... source)
FloatIterable
containsAll
in interface FloatIterable
public boolean containsAll(FloatIterable source)
FloatIterable
containsAll
in interface FloatIterable
public FloatIterator floatIterator()
floatIterator
in interface FloatIterable
public void forEach(FloatProcedure procedure)
FloatIterable
forEach
in interface FloatIterable
public void each(FloatProcedure procedure)
FloatIterable
each
in interface FloatIterable
public int count(FloatPredicate predicate)
FloatIterable
count
in interface FloatIterable
public boolean anySatisfy(FloatPredicate predicate)
FloatIterable
anySatisfy
in interface FloatIterable
public boolean allSatisfy(FloatPredicate predicate)
FloatIterable
allSatisfy
in interface FloatIterable
public boolean noneSatisfy(FloatPredicate predicate)
FloatIterable
noneSatisfy
in interface FloatIterable
public float detectIfNone(FloatPredicate predicate, float ifNone)
detectIfNone
in interface FloatIterable
public MutableFloatStack select(FloatPredicate predicate)
FloatIterable
select
in interface FloatIterable
select
in interface FloatStack
select
in interface MutableFloatStack
select
in interface OrderedFloatIterable
public MutableFloatStack reject(FloatPredicate predicate)
FloatIterable
reject
in interface FloatIterable
reject
in interface FloatStack
reject
in interface MutableFloatStack
reject
in interface OrderedFloatIterable
public <V> MutableStack<V> collect(FloatToObjectFunction<? extends V> function)
FloatIterable
collect
in interface FloatIterable
collect
in interface FloatStack
collect
in interface MutableFloatStack
collect
in interface OrderedFloatIterable
public double sum()
sum
in interface FloatIterable
public float max()
max
in interface FloatIterable
public float min()
min
in interface FloatIterable
public float minIfEmpty(float defaultValue)
minIfEmpty
in interface FloatIterable
public float maxIfEmpty(float defaultValue)
maxIfEmpty
in interface FloatIterable
public double average()
average
in interface FloatIterable
public double median()
median
in interface FloatIterable
public MutableFloatList toSortedList()
toSortedList
in interface FloatIterable
public float[] toSortedArray()
toSortedArray
in interface FloatIterable
public float[] toArray()
FloatIterable
toArray
in interface FloatIterable
public String toString()
PrimitiveIterable
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());
toString
in interface PrimitiveIterable
toString
in class Object
AbstractCollection.toString()
public String makeString()
PrimitiveIterable
PrimitiveIterable.makeString(String)
and defaulting
the separator parameter to the characters ", "
(comma and space).makeString
in interface PrimitiveIterable
public String makeString(String separator)
PrimitiveIterable
PrimitiveIterable.makeString(String, String, String)
and defaulting the start and end parameters to ""
(the empty String).makeString
in interface PrimitiveIterable
public String makeString(String start, String separator, String end)
PrimitiveIterable
makeString
in interface PrimitiveIterable
public void appendString(Appendable appendable)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString()
.appendString
in interface PrimitiveIterable
public void appendString(Appendable appendable, String separator)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString(String)
.appendString
in interface PrimitiveIterable
public void appendString(Appendable appendable, String start, String separator, String end)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString(String, String, String)
.appendString
in interface PrimitiveIterable
public MutableFloatList toList()
FloatIterable
toList
in interface FloatIterable
public MutableFloatSet toSet()
FloatIterable
toSet
in interface FloatIterable
public MutableFloatBag toBag()
FloatIterable
toBag
in interface FloatIterable
public boolean equals(Object otherStack)
FloatStack
StackIterable.equals(Object)
.equals
in interface FloatStack
equals
in class Object
public int hashCode()
FloatStack
StackIterable.hashCode()
.hashCode
in interface FloatStack
hashCode
in class Object
public LazyFloatIterable asLazy()
FloatIterable
asLazy
in interface FloatIterable
public MutableFloatStack asUnmodifiable()
asUnmodifiable
in interface MutableFloatStack
public MutableFloatStack asSynchronized()
asSynchronized
in interface MutableFloatStack
public ImmutableFloatStack toImmutable()
toImmutable
in interface FloatStack
public MutableFloatStack newEmpty()
MutableFloatStack
newEmpty
in interface MutableFloatStack
public <T> T injectInto(T injectedValue, ObjectFloatToObjectFunction<? super T,? extends T> function)
injectInto
in interface FloatIterable
public RichIterable<FloatIterable> chunk(int size)
FloatIterable
chunk
in interface FloatIterable
size
- the number of elements per chunkRichIterable
containing FloatIterable
s of size size
, except the last will be
truncated if the elements don't divide evenly.public float getFirst()
getFirst
in interface OrderedFloatIterable
public int indexOf(float value)
indexOf
in interface OrderedFloatIterable
public <T> T injectIntoWithIndex(T injectedValue, ObjectFloatIntToObjectFunction<? super T,? extends T> function)
injectIntoWithIndex
in interface OrderedFloatIterable
public void forEachWithIndex(FloatIntProcedure procedure)
forEachWithIndex
in interface OrderedFloatIterable
public <V> MutableStack<V> collectWithIndex(FloatIntToObjectFunction<? extends V> function)
collectWithIndex
in interface FloatStack
collectWithIndex
in interface MutableFloatStack
collectWithIndex
in interface OrderedFloatIterable
public <V,R extends Collection<V>> R collectWithIndex(FloatIntToObjectFunction<? extends V> function, R target)
collectWithIndex
in interface OrderedFloatIterable
Copyright © 2004–2019. All rights reserved.