Ableverse™
Platform 6.0

av.util
Interface Stack<T>

All Superinterfaces:
Serializable
All Known Implementing Classes:
ArrayStack, SynchronizedArrayStack

public interface Stack<T>
extends Serializable

This is a light weight (than those of Stack, which is backed by a Vector thus implements all java collections framework interfaces) stack interface that supports pre-peek.

Note: Unlike Stack, implementations of this interface won't throw any exception to indicate element absence or out-of-bounds conditions, they just return null in these cases. Since they also support null value for valid element, so you'll have to consult the size() method to determine whether the null got from peek() or prePeek(int) or pop() is a previously pushed value. Of course if you never push nulls, there is no such necessary.

Author:
Compl

Method Summary
 String catToString(String separator)
          Concate the string value of all elements into a separated string, this is just a utility method to well dump stack content.
 void clear()
           
 boolean isEmpty()
           
 T peek()
           
 T pop()
           
 T prePeek(int nToSkip)
           
 void push(T o)
           
 int size()
           
 

Method Detail

push

void push(T o)

peek

T peek()

prePeek

T prePeek(int nToSkip)

pop

T pop()

isEmpty

boolean isEmpty()

size

int size()

clear

void clear()

catToString

String catToString(String separator)
Concate the string value of all elements into a separated string, this is just a utility method to well dump stack content.

Parameters:
separator - the separator chars for the result

Ableverse™
Platform 6.0

Copyright© 2006 Ableverse Platform. All rights reserved.