FileDocCategorySizeDatePackage
Stack.javaAPI DocAndroid 5.1 API1748Thu Mar 12 22:22:44 GMT 2015com.android.layoutlib.bridge.impl

Stack

public class Stack extends ArrayList
Custom Stack implementation on top of an {@link ArrayList} instead of using {@link java.util.Stack} which is on top of a vector.
param

Fields Summary
private static final long
serialVersionUID
Constructors Summary
public Stack()


      
        super();
    
public Stack(int size)

        super(size);
    
Methods Summary
public Tpeek()
Returns the object at the top of the stack.

return
the object at the top or null if the stack is empty.

        if (size() > 0) {
            return get(size() - 1);
        }

        return null;
    
public Tpop()
Remove the object at the top of the stack and returns it.

return
the removed object or null if the stack was empty.

        if (size() > 0) {
            return remove(size() - 1);
        }

        return null;
    
public voidpush(T object)
Pushes the given object to the stack

param
object the object to push

        add(object);