2 **********************************************************************
3 * Copyright (C) 2003-2011, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
12 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(UStack)
14 UStack::UStack(UErrorCode &status) :
19 UStack::UStack(int32_t initialCapacity, UErrorCode &status) :
20 UVector(initialCapacity, status)
24 UStack::UStack(UObjectDeleter *d, UElementsAreEqual *c, UErrorCode &status) :
29 UStack::UStack(UObjectDeleter *d, UElementsAreEqual *c, int32_t initialCapacity, UErrorCode &status) :
30 UVector(d, c, initialCapacity, status)
36 void* UStack::pop(void) {
37 int32_t n = size() - 1;
40 result = elementAt(n);
46 int32_t UStack::popi(void) {
47 int32_t n = size() - 1;
50 result = elementAti(n);
56 int32_t UStack::search(void* obj) const {
57 int32_t i = indexOf(obj);
58 return (i >= 0) ? size() - i : i;