/*
******************************************************************************
-* Copyright (C) 1997-2006, International Business Machines
+* Copyright (C) 1997-2014, International Business Machines
* Corporation and others. All Rights Reserved.
******************************************************************************
* Date Name Description
#include "unicode/unistr.h"
#include "unicode/uobject.h"
+#include "cmemory.h"
#include "uhash.h"
U_NAMESPACE_BEGIN
/**
* Construct a hashtable
- * @param keyComp Compartor for comparing the keys
- * @param valueComp Compartor for comparing the values
+ * @param keyComp Comparator for comparing the keys
+ * @param valueComp Comparator for comparing the values
* @param status Error code
*/
Hashtable(UKeyComparator *keyComp, UValueComparator *valueComp, UErrorCode& status);
const UHashElement* find(const UnicodeString& key) const;
+ /**
+ * @param pos - must be UHASH_FIRST on first call, and untouched afterwards.
+ * @see uhash_nextElement
+ */
const UHashElement* nextElement(int32_t& pos) const;
- UKeyComparator* setKeyCompartor(UKeyComparator*keyComp);
+ UKeyComparator* setKeyComparator(UKeyComparator*keyComp);
- UValueComparator* setValueCompartor(UValueComparator* valueComp);
+ UValueComparator* setValueComparator(UValueComparator* valueComp);
UBool equals(const Hashtable& that) const;
private:
uhash_init(&hashObj, keyHash, keyComp, valueComp, &status);
if (U_SUCCESS(status)) {
hash = &hashObj;
- uhash_setKeyDeleter(hash, uhash_deleteUnicodeString);
+ uhash_setKeyDeleter(hash, uprv_deleteUObject);
}
}
uhash_removeAll(hash);
}
-inline UKeyComparator* Hashtable::setKeyCompartor(UKeyComparator*keyComp){
+inline UKeyComparator* Hashtable::setKeyComparator(UKeyComparator*keyComp){
return uhash_setKeyComparator(hash, keyComp);
}
-inline UValueComparator* Hashtable::setValueCompartor(UValueComparator* valueComp){
+inline UValueComparator* Hashtable::setValueComparator(UValueComparator* valueComp){
return uhash_setValueComparator(hash, valueComp);
}