Java Code Examples for com.google.common.collect.MapMaker.RemovalListener

The following are top voted examples for showing how to use com.google.common.collect.MapMaker.RemovalListener. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: bts   File: MapMakerInternalMap.java   View source code 6 votes vote down vote up
AbstractSerializationProxy(Strength keyStrength, Strength valueStrength,
    Equivalence<Object> keyEquivalence, Equivalence<Object> valueEquivalence,
    long expireAfterWriteNanos, long expireAfterAccessNanos, int maximumSize,
    int concurrencyLevel, RemovalListener<? super K, ? super V> removalListener,
    ConcurrentMap<K, V> delegate) {
  this.keyStrength = keyStrength;
  this.valueStrength = valueStrength;
  this.keyEquivalence = keyEquivalence;
  this.valueEquivalence = valueEquivalence;
  this.expireAfterWriteNanos = expireAfterWriteNanos;
  this.expireAfterAccessNanos = expireAfterAccessNanos;
  this.maximumSize = maximumSize;
  this.concurrencyLevel = concurrencyLevel;
  this.removalListener = removalListener;
  this.delegate = delegate;
}
 
Example 2
Project: guava-libraries   File: MapMakerInternalMap.java   View source code 6 votes vote down vote up
AbstractSerializationProxy(Strength keyStrength, Strength valueStrength,
    Equivalence<Object> keyEquivalence, Equivalence<Object> valueEquivalence,
    long expireAfterWriteNanos, long expireAfterAccessNanos, int maximumSize,
    int concurrencyLevel, RemovalListener<? super K, ? super V> removalListener,
    ConcurrentMap<K, V> delegate) {
  this.keyStrength = keyStrength;
  this.valueStrength = valueStrength;
  this.keyEquivalence = keyEquivalence;
  this.valueEquivalence = valueEquivalence;
  this.expireAfterWriteNanos = expireAfterWriteNanos;
  this.expireAfterAccessNanos = expireAfterAccessNanos;
  this.maximumSize = maximumSize;
  this.concurrencyLevel = concurrencyLevel;
  this.removalListener = removalListener;
  this.delegate = delegate;
}
 
Example 3
Project: VectorAttackScanner   File: MapMakerInternalMap.java   View source code 6 votes vote down vote up
AbstractSerializationProxy(Strength keyStrength, Strength valueStrength,
    Equivalence<Object> keyEquivalence, Equivalence<Object> valueEquivalence,
    long expireAfterWriteNanos, long expireAfterAccessNanos, int maximumSize,
    int concurrencyLevel, RemovalListener<? super K, ? super V> removalListener,
    ConcurrentMap<K, V> delegate) {
  this.keyStrength = keyStrength;
  this.valueStrength = valueStrength;
  this.keyEquivalence = keyEquivalence;
  this.valueEquivalence = valueEquivalence;
  this.expireAfterWriteNanos = expireAfterWriteNanos;
  this.expireAfterAccessNanos = expireAfterAccessNanos;
  this.maximumSize = maximumSize;
  this.concurrencyLevel = concurrencyLevel;
  this.removalListener = removalListener;
  this.delegate = delegate;
}
 
Example 4
Project: My-Wallet-Android   File: MapMakerInternalMap.java   View source code 6 votes vote down vote up
AbstractSerializationProxy(Strength keyStrength, Strength valueStrength,
    Equivalence<Object> keyEquivalence, Equivalence<Object> valueEquivalence,
    long expireAfterWriteNanos, long expireAfterAccessNanos, int maximumSize,
    int concurrencyLevel, RemovalListener<? super K, ? super V> removalListener,
    ConcurrentMap<K, V> delegate) {
  this.keyStrength = keyStrength;
  this.valueStrength = valueStrength;
  this.keyEquivalence = keyEquivalence;
  this.valueEquivalence = valueEquivalence;
  this.expireAfterWriteNanos = expireAfterWriteNanos;
  this.expireAfterAccessNanos = expireAfterAccessNanos;
  this.maximumSize = maximumSize;
  this.concurrencyLevel = concurrencyLevel;
  this.removalListener = removalListener;
  this.delegate = delegate;
}
 
Example 5
Project: cnGuava   File: MapMakerInternalMap.java   View source code 6 votes vote down vote up
AbstractSerializationProxy(Strength keyStrength, Strength valueStrength,
    Equivalence<Object> keyEquivalence, Equivalence<Object> valueEquivalence,
    long expireAfterWriteNanos, long expireAfterAccessNanos, int maximumSize,
    int concurrencyLevel, RemovalListener<? super K, ? super V> removalListener,
    ConcurrentMap<K, V> delegate) {
  this.keyStrength = keyStrength;
  this.valueStrength = valueStrength;
  this.keyEquivalence = keyEquivalence;
  this.valueEquivalence = valueEquivalence;
  this.expireAfterWriteNanos = expireAfterWriteNanos;
  this.expireAfterAccessNanos = expireAfterAccessNanos;
  this.maximumSize = maximumSize;
  this.concurrencyLevel = concurrencyLevel;
  this.removalListener = removalListener;
  this.delegate = delegate;
}
 
Example 6
Project: otter   File: OtterMigrateMap.java   View source code 6 votes vote down vote up
@SuppressWarnings("deprecation")
public static <K, V> ConcurrentMap<K, V> makeSoftValueComputingMapWithRemoveListenr(MapMaker maker,
                                                                                    Function<? super K, ? extends V> computingFunction,
                                                                                    final OtterRemovalListener listener) {
    return maker.softValues().removalListener(new RemovalListener<K, V>() {

        @Override
        public void onRemoval(RemovalNotification<K, V> notification) {
            if (notification == null) {
                return;
            }

            listener.onRemoval(notification.getKey(), notification.getValue());
        }
    }).makeComputingMap(computingFunction);
}
 
Example 7
Project: org.openntf.domino   File: MapMakerInternalMap.java   View source code 6 votes vote down vote up
AbstractSerializationProxy(Strength keyStrength, Strength valueStrength,
    Equivalence<Object> keyEquivalence, Equivalence<Object> valueEquivalence,
    long expireAfterWriteNanos, long expireAfterAccessNanos, int maximumSize,
    int concurrencyLevel, RemovalListener<? super K, ? super V> removalListener,
    ConcurrentMap<K, V> delegate) {
  this.keyStrength = keyStrength;
  this.valueStrength = valueStrength;
  this.keyEquivalence = keyEquivalence;
  this.valueEquivalence = valueEquivalence;
  this.expireAfterWriteNanos = expireAfterWriteNanos;
  this.expireAfterAccessNanos = expireAfterAccessNanos;
  this.maximumSize = maximumSize;
  this.concurrencyLevel = concurrencyLevel;
  this.removalListener = removalListener;
  this.delegate = delegate;
}
 
Example 8
Project: bts   File: MapMakerInternalMap.java   View source code 5 votes vote down vote up
SerializationProxy(Strength keyStrength, Strength valueStrength,
    Equivalence<Object> keyEquivalence, Equivalence<Object> valueEquivalence,
    long expireAfterWriteNanos, long expireAfterAccessNanos, int maximumSize,
    int concurrencyLevel, RemovalListener<? super K, ? super V> removalListener,
    ConcurrentMap<K, V> delegate) {
  super(keyStrength, valueStrength, keyEquivalence, valueEquivalence, expireAfterWriteNanos,
      expireAfterAccessNanos, maximumSize, concurrencyLevel, removalListener, delegate);
}
 
Example 9
Project: bts   File: ComputingConcurrentHashMap.java   View source code 5 votes vote down vote up
ComputingSerializationProxy(Strength keyStrength, Strength valueStrength,
    Equivalence<Object> keyEquivalence, Equivalence<Object> valueEquivalence,
    long expireAfterWriteNanos, long expireAfterAccessNanos, int maximumSize,
    int concurrencyLevel, RemovalListener<? super K, ? super V> removalListener,
    ConcurrentMap<K, V> delegate, Function<? super K, ? extends V> computingFunction) {
  super(keyStrength, valueStrength, keyEquivalence, valueEquivalence, expireAfterWriteNanos,
      expireAfterAccessNanos, maximumSize, concurrencyLevel, removalListener, delegate);
  this.computingFunction = computingFunction;
}
 
Example 10
Project: guava-libraries   File: MapMakerInternalMap.java   View source code 5 votes vote down vote up
SerializationProxy(Strength keyStrength, Strength valueStrength,
    Equivalence<Object> keyEquivalence, Equivalence<Object> valueEquivalence,
    long expireAfterWriteNanos, long expireAfterAccessNanos, int maximumSize,
    int concurrencyLevel, RemovalListener<? super K, ? super V> removalListener,
    ConcurrentMap<K, V> delegate) {
  super(keyStrength, valueStrength, keyEquivalence, valueEquivalence, expireAfterWriteNanos,
      expireAfterAccessNanos, maximumSize, concurrencyLevel, removalListener, delegate);
}
 
Example 11
Project: guava-libraries   File: ComputingConcurrentHashMap.java   View source code 5 votes vote down vote up
ComputingSerializationProxy(Strength keyStrength, Strength valueStrength,
    Equivalence<Object> keyEquivalence, Equivalence<Object> valueEquivalence,
    long expireAfterWriteNanos, long expireAfterAccessNanos, int maximumSize,
    int concurrencyLevel, RemovalListener<? super K, ? super V> removalListener,
    ConcurrentMap<K, V> delegate, Function<? super K, ? extends V> computingFunction) {
  super(keyStrength, valueStrength, keyEquivalence, valueEquivalence, expireAfterWriteNanos,
      expireAfterAccessNanos, maximumSize, concurrencyLevel, removalListener, delegate);
  this.computingFunction = computingFunction;
}
 
Example 12
Project: guava-libraries   File: MapMakerInternalMapTest.java   View source code 5 votes vote down vote up
public void testSetRemovalListener() {
  RemovalListener<Object, Object> testListener = new RemovalListener<Object, Object>() {
    @Override
    public void onRemoval(RemovalNotification<Object, Object> notification) {}
  };
  MapMakerInternalMap<Object, Object> map =
      makeMap(createMapMaker().removalListener(testListener));
  assertSame(testListener, map.removalListener);
}
 
Example 13
Project: VectorAttackScanner   File: MapMakerInternalMap.java   View source code 5 votes vote down vote up
SerializationProxy(Strength keyStrength, Strength valueStrength,
    Equivalence<Object> keyEquivalence, Equivalence<Object> valueEquivalence,
    long expireAfterWriteNanos, long expireAfterAccessNanos, int maximumSize,
    int concurrencyLevel, RemovalListener<? super K, ? super V> removalListener,
    ConcurrentMap<K, V> delegate) {
  super(keyStrength, valueStrength, keyEquivalence, valueEquivalence, expireAfterWriteNanos,
      expireAfterAccessNanos, maximumSize, concurrencyLevel, removalListener, delegate);
}
 
Example 14
Project: VectorAttackScanner   File: ComputingConcurrentHashMap.java   View source code 5 votes vote down vote up
ComputingSerializationProxy(Strength keyStrength, Strength valueStrength,
    Equivalence<Object> keyEquivalence, Equivalence<Object> valueEquivalence,
    long expireAfterWriteNanos, long expireAfterAccessNanos, int maximumSize,
    int concurrencyLevel, RemovalListener<? super K, ? super V> removalListener,
    ConcurrentMap<K, V> delegate, Function<? super K, ? extends V> computingFunction) {
  super(keyStrength, valueStrength, keyEquivalence, valueEquivalence, expireAfterWriteNanos,
      expireAfterAccessNanos, maximumSize, concurrencyLevel, removalListener, delegate);
  this.computingFunction = computingFunction;
}
 
Example 15
Project: My-Wallet-Android   File: MapMakerInternalMap.java   View source code 5 votes vote down vote up
SerializationProxy(Strength keyStrength, Strength valueStrength,
    Equivalence<Object> keyEquivalence, Equivalence<Object> valueEquivalence,
    long expireAfterWriteNanos, long expireAfterAccessNanos, int maximumSize,
    int concurrencyLevel, RemovalListener<? super K, ? super V> removalListener,
    ConcurrentMap<K, V> delegate) {
  super(keyStrength, valueStrength, keyEquivalence, valueEquivalence, expireAfterWriteNanos,
      expireAfterAccessNanos, maximumSize, concurrencyLevel, removalListener, delegate);
}
 
Example 16
Project: My-Wallet-Android   File: ComputingConcurrentHashMap.java   View source code 5 votes vote down vote up
ComputingSerializationProxy(Strength keyStrength, Strength valueStrength,
    Equivalence<Object> keyEquivalence, Equivalence<Object> valueEquivalence,
    long expireAfterWriteNanos, long expireAfterAccessNanos, int maximumSize,
    int concurrencyLevel, RemovalListener<? super K, ? super V> removalListener,
    ConcurrentMap<K, V> delegate, Function<? super K, ? extends V> computingFunction) {
  super(keyStrength, valueStrength, keyEquivalence, valueEquivalence, expireAfterWriteNanos,
      expireAfterAccessNanos, maximumSize, concurrencyLevel, removalListener, delegate);
  this.computingFunction = computingFunction;
}
 
Example 17
Project: cnGuava   File: MapMakerInternalMap.java   View source code 5 votes vote down vote up
SerializationProxy(Strength keyStrength, Strength valueStrength,
    Equivalence<Object> keyEquivalence, Equivalence<Object> valueEquivalence,
    long expireAfterWriteNanos, long expireAfterAccessNanos, int maximumSize,
    int concurrencyLevel, RemovalListener<? super K, ? super V> removalListener,
    ConcurrentMap<K, V> delegate) {
  super(keyStrength, valueStrength, keyEquivalence, valueEquivalence, expireAfterWriteNanos,
      expireAfterAccessNanos, maximumSize, concurrencyLevel, removalListener, delegate);
}
 
Example 18
Project: cnGuava   File: ComputingConcurrentHashMap.java   View source code 5 votes vote down vote up
ComputingSerializationProxy(Strength keyStrength, Strength valueStrength,
    Equivalence<Object> keyEquivalence, Equivalence<Object> valueEquivalence,
    long expireAfterWriteNanos, long expireAfterAccessNanos, int maximumSize,
    int concurrencyLevel, RemovalListener<? super K, ? super V> removalListener,
    ConcurrentMap<K, V> delegate, Function<? super K, ? extends V> computingFunction) {
  super(keyStrength, valueStrength, keyEquivalence, valueEquivalence, expireAfterWriteNanos,
      expireAfterAccessNanos, maximumSize, concurrencyLevel, removalListener, delegate);
  this.computingFunction = computingFunction;
}
 
Example 19
Project: otter   File: OtterMigrateMap.java   View source code 5 votes vote down vote up
@SuppressWarnings("deprecation")
public static <K, V> ConcurrentMap<K, V> makeSoftValueComputingMapWithRemoveListenr(Function<? super K, ? extends V> computingFunction,
                                                                                    final OtterRemovalListener<K, V> listener) {
    return new MapMaker().softValues().removalListener(new RemovalListener<K, V>() {

        @Override
        public void onRemoval(RemovalNotification<K, V> notification) {
            if (notification == null) {
                return;
            }

            listener.onRemoval(notification.getKey(), notification.getValue());
        }
    }).makeComputingMap(computingFunction);
}
 
Example 20
Project: org.openntf.domino   File: MapMakerInternalMap.java   View source code 5 votes vote down vote up
SerializationProxy(Strength keyStrength, Strength valueStrength,
    Equivalence<Object> keyEquivalence, Equivalence<Object> valueEquivalence,
    long expireAfterWriteNanos, long expireAfterAccessNanos, int maximumSize,
    int concurrencyLevel, RemovalListener<? super K, ? super V> removalListener,
    ConcurrentMap<K, V> delegate) {
  super(keyStrength, valueStrength, keyEquivalence, valueEquivalence, expireAfterWriteNanos,
      expireAfterAccessNanos, maximumSize, concurrencyLevel, removalListener, delegate);
}
 
Example 21
Project: org.openntf.domino   File: ComputingConcurrentHashMap.java   View source code 5 votes vote down vote up
ComputingSerializationProxy(Strength keyStrength, Strength valueStrength,
    Equivalence<Object> keyEquivalence, Equivalence<Object> valueEquivalence,
    long expireAfterWriteNanos, long expireAfterAccessNanos, int maximumSize,
    int concurrencyLevel, RemovalListener<? super K, ? super V> removalListener,
    ConcurrentMap<K, V> delegate, Function<? super K, ? extends V> computingFunction) {
  super(keyStrength, valueStrength, keyEquivalence, valueEquivalence, expireAfterWriteNanos,
      expireAfterAccessNanos, maximumSize, concurrencyLevel, removalListener, delegate);
  this.computingFunction = computingFunction;
}
 
Example 22
Project: bts   File: GenericMapMaker.java   View source code 4 votes vote down vote up
@SuppressWarnings("unchecked") // safe covariant cast
@GwtIncompatible("To be supported")
<K extends K0, V extends V0> RemovalListener<K, V> getRemovalListener() {
  return (RemovalListener<K, V>) Objects.firstNonNull(removalListener, NullListener.INSTANCE);
}
 
Example 23
Project: j2objc   File: GenericMapMaker.java   View source code 4 votes vote down vote up
@SuppressWarnings("unchecked") // safe covariant cast
@GwtIncompatible("To be supported")
<K extends K0, V extends V0> RemovalListener<K, V> getRemovalListener() {
  return (RemovalListener<K, V>) Objects.firstNonNull(removalListener, NullListener.INSTANCE);
}
 
Example 24
Project: guava-libraries   File: GenericMapMaker.java   View source code 4 votes vote down vote up
@SuppressWarnings("unchecked") // safe covariant cast
@GwtIncompatible("To be supported")
<K extends K0, V extends V0> RemovalListener<K, V> getRemovalListener() {
  return (RemovalListener<K, V>) MoreObjects.firstNonNull(removalListener, NullListener.INSTANCE);
}
 
Example 25
Project: VectorAttackScanner   File: GenericMapMaker.java   View source code 4 votes vote down vote up
@SuppressWarnings("unchecked") // safe covariant cast
@GwtIncompatible("To be supported")
<K extends K0, V extends V0> RemovalListener<K, V> getRemovalListener() {
  return (RemovalListener<K, V>) MoreObjects.firstNonNull(removalListener, NullListener.INSTANCE);
}
 
Example 26
Project: My-Wallet-Android   File: GenericMapMaker.java   View source code 4 votes vote down vote up
@SuppressWarnings("unchecked") // safe covariant cast
@GwtIncompatible("To be supported")
<K extends K0, V extends V0> RemovalListener<K, V> getRemovalListener() {
  return (RemovalListener<K, V>) Objects.firstNonNull(removalListener, NullListener.INSTANCE);
}
 
Example 27
Project: cnGuava   File: GenericMapMaker.java   View source code 4 votes vote down vote up
@SuppressWarnings("unchecked") // safe covariant cast
@GwtIncompatible("To be supported")
<K extends K0, V extends V0> RemovalListener<K, V> getRemovalListener() {
  return (RemovalListener<K, V>) Objects.firstNonNull(removalListener, NullListener.INSTANCE);
}
 
Example 28
Project: org.openntf.domino   File: GenericMapMaker.java   View source code 4 votes vote down vote up
@SuppressWarnings("unchecked") // safe covariant cast
@GwtIncompatible("To be supported")
<K extends K0, V extends V0> RemovalListener<K, V> getRemovalListener() {
  return (RemovalListener<K, V>) MoreObjects.firstNonNull(removalListener, NullListener.INSTANCE);
}