00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _DECAF_UTIL_LINKEDHASHMAP_H_
00019 #define _DECAF_UTIL_LINKEDHASHMAP_H_
00020
00021 #include <decaf/util/Config.h>
00022
00023 #include <decaf/util/HashMap.h>
00024
00025 namespace decaf {
00026 namespace util {
00027
00110 template<typename K, typename V, typename HASHCODE = HashCode<K> >
00111 class LinkedHashMap : public HashMap<K, V, HASHCODE> {
00112 private:
00113
00114 class LinkedHashMapEntry : public HashMap<K, V, HASHCODE>::HashMapEntry {
00115 private:
00116
00117 LinkedHashMapEntry(const LinkedHashMapEntry&);
00118 LinkedHashMapEntry& operator= (const LinkedHashMapEntry&);
00119
00120 public:
00121
00122 LinkedHashMapEntry* chainForward;
00123 LinkedHashMapEntry* chainBackward;
00124
00125 public:
00126
00127 LinkedHashMapEntry(const K& key, const V& value, int hash) :
00128 HashMap<K, V, HASHCODE>::HashMapEntry(key, value, hash), chainForward(), chainBackward() {
00129 }
00130
00131 LinkedHashMapEntry(const K& key, const V& value) :
00132 HashMap<K, V, HASHCODE>::HashMapEntry(key, value), chainForward(), chainBackward() {
00133 }
00134 };
00135
00136 private:
00137
00138 bool accessOrder;
00139 mutable LinkedHashMapEntry* head;
00140 mutable LinkedHashMapEntry* tail;
00141
00142 private:
00143
00144 class AbstractMapIterator {
00145 protected:
00146
00147 int expectedModCount;
00148 LinkedHashMapEntry* futureEntry;
00149 LinkedHashMapEntry* currentEntry;
00150 LinkedHashMap* associatedMap;
00151
00152 private:
00153
00154 AbstractMapIterator(const AbstractMapIterator&);
00155 AbstractMapIterator& operator= (const AbstractMapIterator&);
00156
00157 public:
00158
00159 AbstractMapIterator(LinkedHashMap* parent) : expectedModCount(parent->modCount),
00160 futureEntry(parent->head),
00161 currentEntry(NULL),
00162 associatedMap(parent) {
00163 }
00164
00165 virtual ~AbstractMapIterator() {}
00166
00167 void checkConcurrentMod() const {
00168 if (expectedModCount != associatedMap->modCount) {
00169 throw ConcurrentModificationException(
00170 __FILE__, __LINE__, "LinkedHashMap modified outside this iterator");
00171 }
00172 }
00173
00174 virtual bool checkHasNext() const {
00175 return (futureEntry != NULL);
00176 }
00177
00178 void makeNext() {
00179 checkConcurrentMod();
00180 if (!checkHasNext()) {
00181 throw decaf::util::NoSuchElementException(
00182 __FILE__, __LINE__, "No next element");
00183 }
00184 currentEntry = futureEntry;
00185 futureEntry = futureEntry->chainForward;
00186 }
00187
00188 virtual void doRemove() {
00189 checkConcurrentMod();
00190 if (currentEntry == NULL) {
00191 throw decaf::lang::exceptions::IllegalStateException(
00192 __FILE__, __LINE__, "Remove called before call to next()");
00193 }
00194
00195 LinkedHashMapEntry* entry = currentEntry;
00196 LinkedHashMapEntry* prev = entry->chainBackward;
00197 LinkedHashMapEntry* next = entry->chainForward;
00198 LinkedHashMap* map = associatedMap;
00199
00200
00201 associatedMap->removeEntry(currentEntry);
00202 currentEntry = NULL;
00203
00204 if (prev != NULL) {
00205 prev->chainForward = next;
00206 if (next != NULL) {
00207 next->chainBackward = prev;
00208 } else {
00209 map->tail = prev;
00210 }
00211 } else {
00212 map->head = next;
00213 if (next != NULL) {
00214 next->chainBackward = NULL;
00215 } else {
00216 map->tail = NULL;
00217 }
00218 }
00219 expectedModCount++;
00220 }
00221
00222 };
00223
00224 class EntryIterator : public Iterator< MapEntry<K,V> >, public AbstractMapIterator {
00225 private:
00226
00227 EntryIterator(const EntryIterator&);
00228 EntryIterator& operator= (const EntryIterator&);
00229
00230 public:
00231
00232 EntryIterator(LinkedHashMap* parent) : AbstractMapIterator(parent) {
00233 }
00234
00235 virtual ~EntryIterator() {}
00236
00237 virtual bool hasNext() const {
00238 return this->checkHasNext();
00239 }
00240
00241 virtual MapEntry<K, V> next() {
00242 this->makeNext();
00243 return *(this->currentEntry);
00244 }
00245
00246 virtual void remove() {
00247 this->doRemove();
00248 }
00249 };
00250
00251 class KeyIterator : public Iterator<K>, public AbstractMapIterator {
00252 private:
00253
00254 KeyIterator(const KeyIterator&);
00255 KeyIterator& operator= (const KeyIterator&);
00256
00257 public:
00258
00259 KeyIterator(LinkedHashMap* parent) : AbstractMapIterator(parent) {
00260 }
00261
00262 virtual ~KeyIterator() {}
00263
00264 virtual bool hasNext() const {
00265 return this->checkHasNext();
00266 }
00267
00268 virtual K next() {
00269 this->makeNext();
00270 return this->currentEntry->getKey();
00271 }
00272
00273 virtual void remove() {
00274 this->doRemove();
00275 }
00276 };
00277
00278 class ValueIterator : public Iterator<V>, public AbstractMapIterator {
00279 private:
00280
00281 ValueIterator(const ValueIterator&);
00282 ValueIterator& operator= (const ValueIterator&);
00283
00284 public:
00285
00286 ValueIterator(LinkedHashMap* parent) : AbstractMapIterator(parent) {
00287 }
00288
00289 virtual ~ValueIterator() {}
00290
00291 virtual bool hasNext() const {
00292 return this->checkHasNext();
00293 }
00294
00295 virtual V next() {
00296 this->makeNext();
00297 return this->currentEntry->getValue();
00298 }
00299
00300 virtual void remove() {
00301 this->doRemove();
00302 }
00303 };
00304
00305 private:
00306
00307 class ConstAbstractMapIterator {
00308 protected:
00309
00310 int expectedModCount;
00311 const LinkedHashMapEntry* futureEntry;
00312 const LinkedHashMapEntry* currentEntry;
00313 const LinkedHashMap* associatedMap;
00314
00315 private:
00316
00317 ConstAbstractMapIterator(const ConstAbstractMapIterator&);
00318 ConstAbstractMapIterator& operator= (const ConstAbstractMapIterator&);
00319
00320 public:
00321
00322 ConstAbstractMapIterator(const LinkedHashMap* parent) : expectedModCount(parent->modCount),
00323 futureEntry(parent->head),
00324 currentEntry(NULL),
00325 associatedMap(parent) {
00326 }
00327
00328 virtual ~ConstAbstractMapIterator() {}
00329
00330 virtual bool checkHasNext() const {
00331 return (futureEntry != NULL);
00332 }
00333
00334 void checkConcurrentMod() const {
00335 if (expectedModCount != associatedMap->modCount) {
00336 throw ConcurrentModificationException(
00337 __FILE__, __LINE__, "LinkedHashMap modified outside this iterator");
00338 }
00339 }
00340
00341 void makeNext() {
00342 checkConcurrentMod();
00343 if (!checkHasNext()) {
00344 throw decaf::util::NoSuchElementException(
00345 __FILE__, __LINE__, "No next element");
00346 }
00347 currentEntry = futureEntry;
00348 futureEntry = futureEntry->chainForward;
00349 }
00350 };
00351
00352 class ConstEntryIterator : public Iterator< MapEntry<K,V> >, public ConstAbstractMapIterator {
00353 private:
00354
00355 ConstEntryIterator(const ConstEntryIterator&);
00356 ConstEntryIterator& operator= (const ConstEntryIterator&);
00357
00358 public:
00359
00360 ConstEntryIterator(const LinkedHashMap* parent) : ConstAbstractMapIterator(parent) {
00361 }
00362
00363 virtual ~ConstEntryIterator() {}
00364
00365 virtual bool hasNext() const {
00366 return this->checkHasNext();
00367 }
00368
00369 virtual MapEntry<K, V> next() {
00370 this->makeNext();
00371 return *(this->currentEntry);
00372 }
00373
00374 virtual void remove() {
00375 throw lang::exceptions::UnsupportedOperationException(
00376 __FILE__, __LINE__, "Cannot write to a const Iterator." );
00377 }
00378 };
00379
00380 class ConstKeyIterator : public Iterator<K>, public ConstAbstractMapIterator {
00381 private:
00382
00383 ConstKeyIterator(const ConstKeyIterator&);
00384 ConstKeyIterator& operator= (const ConstKeyIterator&);
00385
00386 public:
00387
00388 ConstKeyIterator(const LinkedHashMap* parent) : ConstAbstractMapIterator(parent) {
00389 }
00390
00391 virtual ~ConstKeyIterator() {}
00392
00393 virtual bool hasNext() const {
00394 return this->checkHasNext();
00395 }
00396
00397 virtual K next() {
00398 this->makeNext();
00399 return this->currentEntry->getKey();
00400 }
00401
00402 virtual void remove() {
00403 throw lang::exceptions::UnsupportedOperationException(
00404 __FILE__, __LINE__, "Cannot write to a const Iterator." );
00405 }
00406 };
00407
00408 class ConstValueIterator : public Iterator<V>, public ConstAbstractMapIterator {
00409 private:
00410
00411 ConstValueIterator(const ConstValueIterator&);
00412 ConstValueIterator& operator= (const ConstValueIterator&);
00413
00414 public:
00415
00416 ConstValueIterator(const LinkedHashMap* parent) : ConstAbstractMapIterator(parent) {
00417 }
00418
00419 virtual ~ConstValueIterator() {}
00420
00421 virtual bool hasNext() const {
00422 return this->checkHasNext();
00423 }
00424
00425 virtual V next() {
00426 this->makeNext();
00427 return this->currentEntry->getValue();
00428 }
00429
00430 virtual void remove() {
00431 throw lang::exceptions::UnsupportedOperationException(
00432 __FILE__, __LINE__, "Cannot write to a const Iterator." );
00433 }
00434 };
00435
00436 private:
00437
00438
00439 class LinkedHashMapEntrySet : public HashMap<K, V, HASHCODE>::HashMapEntrySet {
00440 private:
00441
00442 LinkedHashMap* associatedMap;
00443
00444 private:
00445
00446 LinkedHashMapEntrySet(const LinkedHashMapEntrySet&);
00447 LinkedHashMapEntrySet& operator= (const LinkedHashMapEntrySet&);
00448
00449 public:
00450
00451 LinkedHashMapEntrySet(LinkedHashMap* parent) :
00452 HashMap<K, V, HASHCODE>::HashMapEntrySet(parent), associatedMap(parent) {
00453 }
00454
00455 virtual ~LinkedHashMapEntrySet() {}
00456
00457 virtual Iterator< MapEntry<K, V> >* iterator() {
00458 return new EntryIterator(associatedMap);
00459 }
00460
00461 virtual Iterator< MapEntry<K, V> >* iterator() const {
00462 return new ConstEntryIterator(associatedMap);
00463 }
00464 };
00465
00466
00467 class ConstLinkedHashMapEntrySet : public HashMap<K, V, HASHCODE>::ConstHashMapEntrySet {
00468 private:
00469
00470 const LinkedHashMap* associatedMap;
00471
00472 private:
00473
00474 ConstLinkedHashMapEntrySet(const ConstLinkedHashMapEntrySet&);
00475 ConstLinkedHashMapEntrySet& operator= (const ConstLinkedHashMapEntrySet&);
00476
00477 public:
00478
00479 ConstLinkedHashMapEntrySet(const LinkedHashMap* parent) :
00480 HashMap<K, V, HASHCODE>::ConstHashMapEntrySet(parent), associatedMap(parent) {
00481 }
00482
00483 virtual ~ConstLinkedHashMapEntrySet() {}
00484
00485 virtual Iterator< MapEntry<K, V> >* iterator() {
00486 throw decaf::lang::exceptions::UnsupportedOperationException(
00487 __FILE__, __LINE__, "Can't return a non-const iterator for a const collection");
00488 }
00489
00490 virtual Iterator< MapEntry<K, V> >* iterator() const {
00491 return new ConstEntryIterator(associatedMap);
00492 }
00493 };
00494
00495 private:
00496
00497 class LinkedHashMapKeySet : public HashMap<K, V, HASHCODE>::HashMapKeySet {
00498 private:
00499
00500 LinkedHashMap* associatedMap;
00501
00502 private:
00503
00504 LinkedHashMapKeySet(const LinkedHashMapKeySet&);
00505 LinkedHashMapKeySet& operator= (const LinkedHashMapKeySet&);
00506
00507 public:
00508
00509 LinkedHashMapKeySet(LinkedHashMap* parent) :
00510 HashMap<K, V, HASHCODE>::HashMapKeySet(parent), associatedMap(parent) {
00511 }
00512
00513 virtual ~LinkedHashMapKeySet() {}
00514
00515 virtual Iterator<K>* iterator() {
00516 return new KeyIterator(this->associatedMap);
00517 }
00518
00519 virtual Iterator<K>* iterator() const {
00520 return new ConstKeyIterator(this->associatedMap);
00521 }
00522 };
00523
00524 class ConstLinkedHashMapKeySet : public HashMap<K, V, HASHCODE>::ConstHashMapKeySet {
00525 private:
00526
00527 const LinkedHashMap* associatedMap;
00528
00529 private:
00530
00531 ConstLinkedHashMapKeySet(const ConstLinkedHashMapKeySet&);
00532 ConstLinkedHashMapKeySet& operator= (const ConstLinkedHashMapKeySet&);
00533
00534 public:
00535
00536 ConstLinkedHashMapKeySet(const LinkedHashMap* parent) :
00537 HashMap<K, V, HASHCODE>::ConstHashMapKeySet(parent), associatedMap(parent) {
00538 }
00539
00540 virtual ~ConstLinkedHashMapKeySet() {}
00541
00542 virtual Iterator<K>* iterator() const {
00543 return new ConstKeyIterator(this->associatedMap);
00544 }
00545 };
00546
00547 private:
00548
00549 class LinkedHashMapValueCollection : public HashMap<K, V, HASHCODE>::HashMapValueCollection {
00550 private:
00551
00552 LinkedHashMap* associatedMap;
00553
00554 private:
00555
00556 LinkedHashMapValueCollection(const LinkedHashMapValueCollection&);
00557 LinkedHashMapValueCollection& operator= (const LinkedHashMapValueCollection&);
00558
00559 public:
00560
00561 LinkedHashMapValueCollection(LinkedHashMap* parent) :
00562 HashMap<K, V, HASHCODE>::HashMapValueCollection(parent), associatedMap(parent) {
00563 }
00564
00565 virtual ~LinkedHashMapValueCollection() {}
00566
00567 virtual Iterator<V>* iterator() {
00568 return new ValueIterator(this->associatedMap);
00569 }
00570
00571 virtual Iterator<V>* iterator() const {
00572 return new ConstValueIterator(this->associatedMap);
00573 }
00574 };
00575
00576 class ConstLinkedHashMapValueCollection : public HashMap<K, V, HASHCODE>::ConstHashMapValueCollection {
00577 private:
00578
00579 const LinkedHashMap* associatedMap;
00580
00581 private:
00582
00583 ConstLinkedHashMapValueCollection(const ConstLinkedHashMapValueCollection&);
00584 ConstLinkedHashMapValueCollection& operator= (const ConstLinkedHashMapValueCollection&);
00585
00586 public:
00587
00588 ConstLinkedHashMapValueCollection(const LinkedHashMap* parent) :
00589 HashMap<K, V, HASHCODE>::ConstHashMapValueCollection(parent), associatedMap(parent) {
00590 }
00591
00592 virtual ~ConstLinkedHashMapValueCollection() {}
00593
00594 virtual Iterator<V>* iterator() const {
00595 return new ConstValueIterator(this->associatedMap);
00596 }
00597 };
00598
00599 public:
00600
00605 LinkedHashMap() : HashMap<K, V, HASHCODE>(), accessOrder(false), head(), tail() {
00606 }
00607
00616 LinkedHashMap(int capacity) : HashMap<K, V, HASHCODE>(capacity), accessOrder(false), head(), tail() {
00617 }
00618
00631 LinkedHashMap(int capacity, float load) :
00632 HashMap<K, V, HASHCODE>(capacity, load), accessOrder(false), head(), tail() {
00633
00634 }
00635
00652 LinkedHashMap(int capacity, float load, bool order) :
00653 HashMap<K, V, HASHCODE>(capacity, load), accessOrder(order), head(), tail() {
00654 }
00655
00663 LinkedHashMap(const HashMap<K,V>& map) : HashMap<K, V, HASHCODE>(map), accessOrder(false), head(), tail() {
00664 }
00665
00666 virtual ~LinkedHashMap() {}
00667
00668 protected:
00669
00681 virtual bool removeEldestEntry(const MapEntry<K, V>& eldest DECAF_UNUSED) {
00682 return false;
00683 }
00684
00694 virtual void onEviction(const MapEntry<K, V>& eldest DECAF_UNUSED) {}
00695
00696 public:
00697
00698 virtual bool containsValue(const V& value) const {
00699 LinkedHashMapEntry* entry = head;
00700 while (entry != NULL) {
00701 if (value == entry->getValue()) {
00702 return true;
00703 }
00704 entry = entry->chainForward;
00705 }
00706 return false;
00707 }
00708
00709 virtual void clear() {
00710 HashMap<K, V, HASHCODE>::clear();
00711 this->head = NULL;
00712 this->tail = NULL;
00713 }
00714
00715 virtual bool put(const K& key, const V& value) {
00716 bool result = this->putImpl(key, value);
00717
00718 if (this->removeEldestEntry(*head)) {
00719 this->onEviction(*head);
00720 this->remove(head->getKey());
00721 }
00722
00723 return result;
00724 }
00725
00726 virtual bool put(const K& key, const V& value, V& oldValue) {
00727 bool result = this->putImpl(key, value, oldValue);
00728
00729 if (this->removeEldestEntry(*head)) {
00730 this->onEviction(*head);
00731 this->remove(head->getKey());
00732 }
00733
00734 return result;
00735 }
00736
00737 virtual V remove(const K& key) {
00738
00739 LinkedHashMapEntry* toRemove = (LinkedHashMapEntry*) this->removeEntry(key);
00740 if (toRemove != NULL) {
00741 LinkedHashMapEntry* prev = toRemove->chainBackward;
00742 LinkedHashMapEntry* next = toRemove->chainForward;
00743 if (prev != NULL) {
00744 prev->chainForward = next;
00745 } else {
00746 head = next;
00747 }
00748 if (next != NULL) {
00749 next->chainBackward = prev;
00750 } else {
00751 tail = prev;
00752 }
00753
00754 V oldValue = toRemove->getValue();
00755 delete toRemove;
00756 return oldValue;
00757 }
00758
00759 throw NoSuchElementException(
00760 __FILE__, __LINE__, "Specified key not present in the Map.");
00761 }
00762
00763 virtual Set< MapEntry<K,V> >& entrySet() {
00764 if (this->cachedEntrySet == NULL) {
00765 this->cachedEntrySet.reset(new LinkedHashMapEntrySet(this));
00766 }
00767 return *(this->cachedEntrySet);
00768 }
00769
00770 virtual const Set< MapEntry<K,V> >& entrySet() const {
00771 if (this->cachedConstEntrySet == NULL) {
00772 this->cachedConstEntrySet.reset(new ConstLinkedHashMapEntrySet(this));
00773 }
00774 return *(this->cachedConstEntrySet);
00775 }
00776
00777 virtual Set<K>& keySet() {
00778 if (this->cachedKeySet == NULL) {
00779 this->cachedKeySet.reset(new LinkedHashMapKeySet(this));
00780 }
00781 return *(this->cachedKeySet);
00782 }
00783
00784 virtual const Set<K>& keySet() const {
00785 if (this->cachedConstKeySet == NULL) {
00786 this->cachedConstKeySet.reset(new ConstLinkedHashMapKeySet(this));
00787 }
00788 return *(this->cachedConstKeySet);
00789 }
00790
00791 virtual Collection<V>& values() {
00792 if (this->cachedValueCollection == NULL) {
00793 this->cachedValueCollection.reset(new LinkedHashMapValueCollection(this));
00794 }
00795 return *(this->cachedValueCollection);
00796 }
00797
00798 virtual const Collection<V>& values() const {
00799 if (this->cachedConstValueCollection == NULL) {
00800 this->cachedConstValueCollection.reset(new ConstLinkedHashMapValueCollection(this));
00801 }
00802 return *(this->cachedConstValueCollection);
00803 }
00804
00805 virtual std::string toString() const {
00806 return "LinkedHashMap";
00807 }
00808
00809 protected:
00810
00811 virtual LinkedHashMapEntry* getEntry(const K& key) const {
00812 LinkedHashMapEntry* result = NULL;
00813
00814 int hash = this->hashFunc(key);
00815 int index = hash & (this->elementData.length() - 1);
00816 result = (LinkedHashMapEntry*) this->findKeyEntry(key, index, hash);
00817
00818 if (result != NULL && accessOrder && tail != result) {
00819 LinkedHashMapEntry* prev = result->chainBackward;
00820 LinkedHashMapEntry* next = result->chainForward;
00821 next->chainBackward = prev;
00822 if (prev != NULL) {
00823 prev->chainForward = next;
00824 } else {
00825 head = next;
00826 }
00827 result->chainForward = NULL;
00828 result->chainBackward = tail;
00829 tail->chainForward = result;
00830 tail = result;
00831 }
00832
00833 return result;
00834 }
00835
00836 virtual typename HashMap<K, V, HASHCODE>::HashMapEntry* createEntry(const K& key, int index, const V& value) {
00837 LinkedHashMapEntry* entry = new LinkedHashMapEntry(key, value);
00838 entry->next = this->elementData[index];
00839 this->elementData[index] = entry;
00840 linkEntry(entry);
00841 return entry;
00842 }
00843
00844 virtual typename HashMap<K, V, HASHCODE>::HashMapEntry* createHashedEntry(const K& key, int index, int hash) {
00845 LinkedHashMapEntry* entry = new LinkedHashMapEntry(key, V(), hash);
00846 entry->next = this->elementData[index];
00847 this->elementData[index] = entry;
00848 linkEntry(entry);
00849 return entry;
00850 }
00851
00852 void linkEntry(LinkedHashMapEntry* entry) {
00853 if (tail == entry) {
00854 return;
00855 }
00856
00857 if (head == NULL) {
00858
00859 head = tail = entry;
00860 return;
00861 }
00862
00863
00864
00865 LinkedHashMapEntry* prev = entry->chainBackward;
00866 LinkedHashMapEntry* next = entry->chainForward;
00867 if (prev == NULL) {
00868 if (next != NULL) {
00869
00870 if (accessOrder) {
00871 head = next;
00872 next->chainBackward = NULL;
00873 entry->chainBackward = tail;
00874 entry->chainForward = NULL;
00875 tail->chainForward = entry;
00876 tail = entry;
00877 }
00878 } else {
00879
00880 entry->chainBackward = tail;
00881 entry->chainForward = NULL;
00882 tail->chainForward = entry;
00883 tail = entry;
00884 }
00885 return;
00886 }
00887
00888 if (next == NULL) {
00889
00890 return;
00891 }
00892
00893
00894 if (accessOrder) {
00895 prev->chainForward = next;
00896 next->chainBackward = prev;
00897 entry->chainForward = NULL;
00898 entry->chainBackward = tail;
00899 tail->chainForward = entry;
00900 tail = entry;
00901 }
00902 }
00903
00904 virtual bool putImpl(const K& key, const V& value) {
00905 V oldValue;
00906 return putImpl(key, value, oldValue);
00907 }
00908
00909 virtual bool putImpl(const K& key, const V& value, V& oldValue) {
00910
00911 LinkedHashMapEntry* entry;
00912 if (this->elementCount == 0) {
00913 head = tail = NULL;
00914 }
00915
00916 bool replaced = true;
00917 int hash = this->hashFunc(key);
00918 int index = hash & (this->elementData.length() - 1);
00919
00920 entry = (LinkedHashMapEntry*) this->findKeyEntry(key, index, hash);
00921 if (entry == NULL) {
00922 this->modCount++;
00923 if (++this->elementCount > this->threshold) {
00924 this->rehash();
00925 index = hash & (this->elementData.length() - 1);
00926 }
00927 entry = (LinkedHashMapEntry*) this->createHashedEntry(key, index, hash);
00928 replaced = false;
00929 } else {
00930 this->linkEntry(entry);
00931 oldValue = entry->getValue();
00932 }
00933
00934 entry->setValue(value);
00935 return replaced;
00936 }
00937
00938 };
00939
00940 }}
00941
00942 #endif