com.alibaba.dubbo.common.utils
Class Stack<E>

java.lang.Object
  extended by com.alibaba.dubbo.common.utils.Stack<E>

public class Stack<E>
extends Object

Stack.

Author:
qian.lei

Constructor Summary
Stack()
           
 
Method Summary
 void clear()
          clear stack.
 E get(int index)
          get.
 boolean isEmpty()
          is empty.
 E peek()
          peek.
 E pop()
          pop.
 void push(E ele)
          push.
 E remove(int index)
          remove.
 E set(int index, E value)
          set.
 int size()
          get stack size.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Stack

public Stack()
Method Detail

push

public void push(E ele)
push.

Parameters:
ele -

pop

public E pop()
pop.

Returns:
the last element.

peek

public E peek()
peek.

Returns:
the last element.

get

public E get(int index)
get.

Parameters:
index - index.
Returns:
element.

set

public E set(int index,
             E value)
set.

Parameters:
index - index.
value - element.
Returns:
old element.

remove

public E remove(int index)
remove.

Parameters:
index -
Returns:
element

size

public int size()
get stack size.

Returns:
size.

isEmpty

public boolean isEmpty()
is empty.

Returns:
empty or not.

clear

public void clear()
clear stack.



Copyright © 2012–2017 Alibaba. All rights reserved.