Пример #1
0
 public final Ref<V> visionallyRead(K key, QueuedOperationType nullOrOperationType) {
   XMap<K, V> delayOrphanMap = this.delayOrphanMap;
   if (delayOrphanMap != null && delayOrphanMap.containsKey(key)) {
     return new Ref<V>(null);
   }
   if (!this.isVisionallyReadable(nullOrOperationType)) {
     return null;
   }
   return this.onVisionallyRead(key, nullOrOperationType);
 }
Пример #2
0
 public final boolean performQueuedOrphans() {
   if (this.isLoaded()) {
     XMap<K, V> map = this.delayOrphanMap;
     if (map != null) {
       this.delayOrphanMap = null;
       this.getBase().keySet().removeAll(map.keySet());
       return true;
     }
   }
   return false;
 }
Пример #3
0
 @Override
 protected XKeySetView<K> createBaseView(XMap<K, V> baseMap, ViewInfo viewInfo) {
   if (viewInfo instanceof MapViewInfos.KeySet) {
     return baseMap.keySet();
   }
   throw new IllegalArgumentException(LAZY_COMMON_RESOURCE.get().illegalViewInfo());
 }
Пример #4
0
 @SuppressWarnings("unchecked")
 @Override
 protected org.babyfish.collection.XMap.XEntry<K, V> createBaseView(
     XMap<K, V> baseMap, ViewInfo viewInfo) {
   if (viewInfo instanceof MapViewInfos.RealByKey) {
     K key = (K) ((MapViewInfos.RealByKey) viewInfo).getKey();
     return baseMap.real(key);
   }
   throw new IllegalArgumentException(LAZY_COMMON_RESOURCE.get().illegalViewInfo());
 }
Пример #5
0
 final void visinallyRemove(K key, V value) {
   XMap<K, V> delayOrphanMap = this.delayOrphanMap;
   if (delayOrphanMap == null) {
     UnifiedComparator<? super K> keyUnifiedComparator = this.keyUnifiedComparator();
     if (keyUnifiedComparator.comparator() != null) {
       delayOrphanMap =
           new TreeMap<K, V>(
               ReplacementRule.NEW_REFERENCE_WIN,
               keyUnifiedComparator.comparator(),
               this.valueUnifiedComparator());
     } else {
       delayOrphanMap =
           new LinkedHashMap<K, V>(
               ReplacementRule.NEW_REFERENCE_WIN,
               keyUnifiedComparator.equalityComparator(),
               this.valueUnifiedComparator(),
               false,
               OrderAdjustMode.TAIL,
               OrderAdjustMode.TAIL);
     }
     this.delayOrphanMap = delayOrphanMap;
   }
   delayOrphanMap.put(key, value);
 }