net.rim.device.api.util
Class LongStack

java.lang.Object
  extended by net.rim.device.api.util.LongVector
      extended by net.rim.device.api.util.LongStack
All Implemented Interfaces:
Persistable

public class LongStack
extends LongVector
implements Persistable

Last-in-first-out (LIFO) stack of long values.

Since:
BlackBerry API 6.0.0

Field Summary
 
Fields inherited from class net.rim.device.api.util.LongVector
capacityIncrement, elementCount, elementData
 
Constructor Summary
LongStack()
          Creates an empty stack.
LongStack(int initialCapacityInt)
          Allows the creation of the stack with a different initial capacity.
 
Method Summary
 long peek()
          Retrieves the long at the top of this stack without removing it.
 long pop()
          Retrieves the long at the top of the stack and removes it.
 long push(long valueLong)
          Pushes a long onto the top of this stack.
 int search(int valueLong)
          Returns the 1-based position where a long is on this stack.
 
Methods inherited from class net.rim.device.api.util.LongVector
addElement, addElements, capacity, contains, copyInto, elementAt, ensureCapacity, firstElement, getArray, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, removeAllElements, removeElement, removeElementAt, setElementAt, setSize, size, toArray, trimToSize
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Constructor Detail

LongStack

public LongStack()
Creates an empty stack.

Since:
BlackBerry API 6.0.0

LongStack

public LongStack(int initialCapacityInt)
Allows the creation of the stack with a different initial capacity.

Parameters:
initialCapacityInt - Initial capacity to use.
Since:
BlackBerry API 6.0.0


Method Detail

push

public long push(long valueLong)
Pushes a long onto the top of this stack.

Parameters:
valueLong - Value to push.
Returns:
Long value pushed.
Since:
BlackBerry API 6.0.0

pop

public long pop()
Retrieves the long at the top of the stack and removes it.

Returns:
Long value at the top of the stack.
Since:
BlackBerry API 6.0.0

peek

public long peek()
Retrieves the long at the top of this stack without removing it.

Returns:
Long value at the top of the stack.
Since:
BlackBerry API 6.0.0

search

public int search(int valueLong)
Returns the 1-based position where a long is on this stack. If the value occurs as an item in this stack, this method returns the distance from the top of the stack of the occurrence nearest the top of the stack; the topmost item on the stack is considered to be at distance 1.

Parameters:
valueLong - Value to search for.
Returns:
1-based position from the top of the stack where the value is located.
Since:
BlackBerry API 6.0.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.