java.util
Class Stack

java.lang.Object
  |
  +--java.util.Vector
        |
        +--java.util.Stack

public class Stack
extends Vector

스택 구조체을 위한 클래스.


Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Constructor Summary
Stack()
          새로운 스택 객체를 만든다.
 
Method Summary
 boolean empty()
          스택이 비었는지 여부를 구한다.
 Object peek()
          스택 맨위 객체를 스택에서 제거하지 않고 구한다.
 Object pop()
          스택에 객체를 pop한다.
 Object push(Object item)
          스택에 객체를 push한다.
 int search(Object o)
          특정 객체가 스택 맨위에서 부터 몇번째에 위치하는지 구한다.
 
Methods inherited from class java.util.Vector
addElement, capacity, contains, copyInto, elementAt, elements, ensureCapacity, firstElement, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, removeAllElements, removeElement, removeElementAt, setElementAt, setSize, size, toString, trimToSize
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Stack

public Stack()
새로운 스택 객체를 만든다.
Method Detail

push

public Object push(Object item)
스택에 객체를 push한다.
Parameters:
item - push할 대상.
Returns:
push할 대상.

pop

public Object pop()
스택에 객체를 pop한다.
Returns:
pop한 객체.
Throws:
EmptyStackException - 스택이 비었을 때.

peek

public Object peek()
스택 맨위 객체를 스택에서 제거하지 않고 구한다.
Returns:
스택 맨위 객체.
Throws:
EmptyStackException - 스택이 비었을 때.

empty

public boolean empty()
스택이 비었는지 여부를 구한다.
Returns:
비었으면 true 아니면 false.

search

public int search(Object o)
특정 객체가 스택 맨위에서 부터 몇번째에 위치하는지 구한다.
Returns:
스택 맨위로 부터 객체의 위치까지 offset 없으면 -1.


AromaSoft Corp. Proprietary and Confidential

(C)opyright 2003 AromaSoft Corp. All right reserved.
Contact : contact@aromasoft.com