@Immutable public final class StackHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static <ELEMENTTYPE> |
getStackCopyWithoutTop(NonBlockingStack<ELEMENTTYPE> aStack) |
static <ELEMENTTYPE> |
newStack() |
static <ELEMENTTYPE> |
newStack(Collection<? extends ELEMENTTYPE> aValues)
Create a new stack from the given collection.
|
static <ELEMENTTYPE> |
newStack(ELEMENTTYPE... aValues)
Create a new stack from the given array.
|
static <ELEMENTTYPE> |
newStack(ELEMENTTYPE aValue)
Create a new stack with a single element.
|
static <ELEMENTTYPE> |
newStack(int nInitialCapacity) |
static <SRCTYPE,DSTTYPE> |
newStackMapped(Collection<? extends SRCTYPE> aCollection,
Function<? super SRCTYPE,DSTTYPE> aMapper) |
@Nonnull @ReturnsMutableCopy public static <ELEMENTTYPE> NonBlockingStack<ELEMENTTYPE> newStack(@Nonnegative int nInitialCapacity)
@Nonnull @ReturnsMutableCopy public static <ELEMENTTYPE> NonBlockingStack<ELEMENTTYPE> newStack()
@Nonnull @ReturnsMutableCopy public static <SRCTYPE,DSTTYPE> NonBlockingStack<DSTTYPE> newStackMapped(@Nullable Collection<? extends SRCTYPE> aCollection, @Nonnull Function<? super SRCTYPE,DSTTYPE> aMapper)
@Nonnull @ReturnsMutableCopy public static <ELEMENTTYPE> NonBlockingStack<ELEMENTTYPE> newStack(@Nullable ELEMENTTYPE aValue)
ELEMENTTYPE - The type of elements contained in the stack.aValue - The value to push. Maybe null.null stack.@Nonnull @ReturnsMutableCopy @SafeVarargs public static <ELEMENTTYPE> NonBlockingStack<ELEMENTTYPE> newStack(@Nullable ELEMENTTYPE... aValues)
ELEMENTTYPE - The type of elements contained in the stack.aValues - The values that are to be pushed on the stack. The last element will
be the top element on the stack. May not be null .null stack object.@Nonnull @ReturnsMutableCopy public static <ELEMENTTYPE> NonBlockingStack<ELEMENTTYPE> newStack(@Nullable Collection<? extends ELEMENTTYPE> aValues)
ELEMENTTYPE - The type of elements contained in the stack.aValues - The values that are to be pushed on the stack. The last element will
be the top element on the stack. May not be null .null stack object.@Nullable @ReturnsMutableCopy public static <ELEMENTTYPE> NonBlockingStack<ELEMENTTYPE> getStackCopyWithoutTop(@Nullable NonBlockingStack<ELEMENTTYPE> aStack)
Copyright © 2014–2016 Philip Helger. All rights reserved.