Logo Search packages:      
Sourcecode: icu version File versions  Download package

UStack Class Reference

#include <uvector.h>

Inheritance diagram for UStack:

UVector UObject UMemory

List of all members.

Detailed Description

Ultralightweight C++ implementation of a void* stack that is (mostly) compatible with java.util.Stack. As in java, this is merely a paper thin layer around UVector. See the UVector documentation for further information.

Design notes

The element at index n-1 is (of course) the top of the stack.

The poorly named empty() method doesn't empty the stack; it determines if the stack is empty.

Alan Liu

Definition at line 304 of file uvector.h.

Public Member Functions

void addElement (int32_t elem, UErrorCode &status)
void addElement (void *obj, UErrorCode &status)
void assign (const UVector &other, UTokenAssigner *assign, UErrorCode &ec)
UBool contains (int32_t obj) const
UBool contains (void *obj) const
UBool containsAll (const UVector &other) const
UBool containsNone (const UVector &other) const
void * elementAt (int32_t index) const
int32_t elementAti (int32_t index) const
UBool empty (void) const
UBool ensureCapacity (int32_t minimumCapacity, UErrorCode &status)
UBool equals (const UVector &other) const
void * firstElement (void) const
virtual UClassID getDynamicClassID () const
int32_t indexOf (int32_t obj, int32_t startIndex=0) const
int32_t indexOf (void *obj, int32_t startIndex=0) const
void insertElementAt (int32_t elem, int32_t index, UErrorCode &status)
void insertElementAt (void *obj, int32_t index, UErrorCode &status)
UBool isEmpty (void) const
void * lastElement (void) const
int32_t lastElementi (void) const
UBool operator!= (const UVector &other)
UBool operator== (const UVector &other)
void * operator[] (int32_t index) const
void * orphanElementAt (int32_t index)
void * peek (void) const
int32_t peeki (void) const
void * pop (void)
int32_t popi (void)
int32_t push (int32_t i, UErrorCode &status)
void * push (void *obj, UErrorCode &status)
UBool removeAll (const UVector &other)
void removeAllElements ()
UBool removeElement (void *obj)
void removeElementAt (int32_t index)
UBool retainAll (const UVector &other)
int32_t search (void *obj) const
UKeyComparator * setComparer (UKeyComparator *c)
UObjectDeleter * setDeleter (UObjectDeleter *d)
void setElementAt (int32_t elem, int32_t index)
void setElementAt (void *obj, int32_t index)
void setSize (int32_t newSize, UErrorCode &status)
int32_t size (void) const
void sort (USortComparator *compare, UErrorCode &ec)
void sortedInsert (int32_t obj, USortComparator *compare, UErrorCode &ec)
void sortedInsert (void *obj, USortComparator *compare, UErrorCode &ec)
void sorti (UErrorCode &ec)
void ** toArray (void **result) const
 UStack (UObjectDeleter *d, UKeyComparator *c, int32_t initialCapacity, UErrorCode &status)
 UStack (UObjectDeleter *d, UKeyComparator *c, UErrorCode &status)
 UStack (int32_t initialCapacity, UErrorCode &status)
 UStack (UErrorCode &status)

Static Public Member Functions

static UClassID U_EXPORT2 getStaticClassID ()
static void U_EXPORT2 operator delete (void *, void *) U_NO_THROW
static void U_EXPORT2 operator delete (void *p) U_NO_THROW
static void U_EXPORT2 operator delete[] (void *p) U_NO_THROW
static void *U_EXPORT2 operator new (size_t, void *ptr) U_NO_THROW
static void *U_EXPORT2 operator new (size_t size) U_NO_THROW
static void *U_EXPORT2 operator new[] (size_t size) U_NO_THROW

Private Member Functions

UStackoperator= (const UStack &)
 UStack (const UStack &)

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index