com.carrotsearch.hppc

Class ObjectStack<KType>

  • All Implemented Interfaces:
    ObjectCollection<KType>, ObjectContainer<KType>, ObjectIndexedContainer<KType>, java.lang.Cloneable, java.lang.Iterable<ObjectCursor<KType>>, java.util.RandomAccess


    @Generated(date="2013-07-09T09:54:21+0200",           value="HPPC generated from: ObjectStack.java")public class ObjectStack<KType>extends ObjectArrayList<KType>
    An extension to ObjectArrayList adding stack-related utility methods. The top of the stack is at the ObjectArrayList.size() - 1 element. A brief comparison of the API against the Java Collections framework:
    Java Collections Stack and HPPC ObjectStack, related methods.
    java.util.Stack ObjectStack
    push push
    pop pop, discard
    peek peek
    removeRange, removeElementAtremoveRange, remove, discard
    size size
    clear clear, release
    + other methods from ObjectArrayList
    • Constructor Detail

      • ObjectStack

        public ObjectStack(int initialCapacity,           ArraySizingStrategy resizer)
        Create with a custom buffer resizing strategy.
      • ObjectStack

        public ObjectStack(ObjectContainer<KType> container)
        Create a stack by pushing all elements of another container to it.
    • Method Detail

      • push

        public void push(KType e1)
        Adds one KType to the stack.
      • push

        public void push(KType e1,        KType e2)
        Adds two KTypes to the stack.
      • push

        public void push(KType e1,        KType e2,        KType e3)
        Adds three KTypes to the stack.
      • push

        public void push(KType[] elements,        int start,        int len)
        Add a range of array elements to the stack.
      • push

        public void push(KType... elements)
        Vararg-signature method for pushing elements at the top of the stack.

        This method is handy, but costly if used in tight loops (anonymous array passing)

      • pushAll

        public int pushAll(ObjectContainer<? extends KType> container)
        Pushes all elements from another container to the top of the stack.
      • pushAll

        public int pushAll(java.lang.Iterable<? extends ObjectCursor<? extends KType>> iterable)
        Pushes all elements from another iterable to the top of the stack.
      • discard

        public void discard(int count)
        Discard an arbitrary number of elements from the top of the stack.
      • discard

        public void discard()
        Discard the top element from the stack.
      • pop

        public KType pop()
        Remove the top element from the stack and return it.
      • peek

        public KType peek()
        Peek at the top element on the stack.
      • newInstance

        public static <KType> ObjectStack<KType> newInstance()
        Returns a new object of this class with no need to declare generic type (shortcut instead of using a constructor).
      • newInstanceWithCapacity

        public static <KType> ObjectStack<KType> newInstanceWithCapacity(int initialCapacity)
        Returns a new object of this list with no need to declare generic type (shortcut instead of using a constructor).
      • from

        public static <KType> ObjectStack<KType> from(KType... elements)
        Create a stack by pushing a variable number of arguments to it.
      • from

        public static <KType> ObjectStack<KType> from(ObjectContainer<KType> container)
        Create a stack by pushing all elements of another container to it.
      • removeAll

        public int removeAll(ObjectLookupContainer<? extends KType> c)
        Default implementation uses a predicate for removal.
        Specified by:
        removeAll in interface ObjectCollection<KType>
        Returns:
        Returns the number of removed elements.
      • retainAll

        public int retainAll(ObjectLookupContainer<? extends KType> c)
        Default implementation uses a predicate for retaining.
        Specified by:
        retainAll in interface ObjectCollection<KType>
        Returns:
        Returns the number of removed elements.
      • toArray

        public KType[] toArray(java.lang.Class<? super KType> clazz)
        Default implementation of copying to an array.
        Specified by:
        toArray in interface ObjectContainer<KType>
      • toString

        public java.lang.String toString()
        Convert the contents of this container to a human-friendly string.
        Overrides:
        toString in class java.lang.Object

Copyright © 2013 Carrot Search s.c.. All Rights Reserved.



NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14