Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

oracle.adfnmc.java.util
Class Stack

java.lang.Object
  extended by oracle.adfnmc.java.util.AbstractCollection
      extended by oracle.adfnmc.java.util.AbstractList
          extended by oracle.adfnmc.java.util.Vector
              extended by oracle.adfnmc.java.util.Stack
All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, List, RandomAccess

public class Stack
extends Vector

Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables users to pop and push onto the stack, including null objects. There is no limit to the size of the stack


Field Summary
 
Fields inherited from class oracle.adfnmc.java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class oracle.adfnmc.java.util.AbstractList
modCount
 
Constructor Summary
Stack()
          Constructs a stack with the default size of Vector.
Stack(Stack s)
           
 
Method Summary
 boolean empty()
          Determines if the stack is empty or not.
 java.lang.Object peek()
          Returns the element at the top of the stack without removing it.
 java.lang.Object pop()
          Returns the element at the top of the stack and removes it.
 java.lang.Object push(java.lang.Object object)
          Pushes the object from the parameter onto the top of the stack.
 int search(java.lang.Object object)
          Returns the index of the first occurrence of the object.
 
Methods inherited from class oracle.adfnmc.java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class oracle.adfnmc.java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.adfnmc.java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

Stack

public Stack()
Constructs a stack with the default size of Vector.


Stack

public Stack(Stack s)
Method Detail

empty

public boolean empty()
Determines if the stack is empty or not.

Returns:
true if the stack is empty, false otherwise

peek

public java.lang.Object peek()
Returns the element at the top of the stack without removing it.

Returns:
the element at the top of the Stack
Throws:
EmptyStackException - when empty() is true
See Also:
pop()

pop

public java.lang.Object pop()
Returns the element at the top of the stack and removes it.

Returns:
the element at the top of the stack.
Throws:
EmptyStackException - when empty() is true
See Also:
peek(), push(java.lang.Object)

push

public java.lang.Object push(java.lang.Object object)
Pushes the object from the parameter onto the top of the stack.

Parameters:
object - The object to be added to the stack
Returns:
the object argument
See Also:
peek(), pop()

search

public int search(java.lang.Object object)
Returns the index of the first occurrence of the object.

Parameters:
object - the object to be searched
Returns:
the index of the first occurrence of the object

Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.