/** * Creates a {@code SoftHashMap} backed by the specified {@code source}, with a default retention * size of {@link #DEFAULT_RETENTION_SIZE DEFAULT_RETENTION_SIZE} (100 entries). * * @param source the backing map to populate this {@code SoftHashMap} * @see #SoftHashMap(Map,int) */ public SoftHashMap(Map<K, V> source) { this(DEFAULT_RETENTION_SIZE); putAll(source); }
/** * Creates a {@code SoftHashMap} backed by the specified {@code source}, with the specified retention size. * <p/> * The retention size (n) is the total number of most recent entries in the map that will be strongly referenced * (ie 'retained') to prevent them from being eagerly garbage collected. That is, the point of a SoftHashMap is to * allow the garbage collector to remove as many entries from this map as it desires, but there will always be (n) * elements retained after a GC due to the strong references. * <p/> * Note that in a highly concurrent environments the exact total number of strong references may differ slightly * than the actual <code>retentionSize</code> value. This number is intended to be a best-effort retention low * water mark. * * @param source the backing map to populate this {@code SoftHashMap} * @param retentionSize the total number of most recent entries in the map that will be strongly referenced * (retained), preventing them from being eagerly garbage collected by the JVM. */ public SoftHashMap(Map<K, V> source, int retentionSize) { this(retentionSize); putAll(source); }
/** * Creates a {@code SoftHashMap} backed by the specified {@code source}, with a default retention * size of {@link #DEFAULT_RETENTION_SIZE DEFAULT_RETENTION_SIZE} (100 entries). * * @param source the backing map to populate this {@code SoftHashMap} * @see #SoftHashMap(Map,int) */ public SoftHashMap(Map<K, V> source) { this(DEFAULT_RETENTION_SIZE); putAll(source); }
/** * Creates a {@code SoftHashMap} backed by the specified {@code source}, with a default retention * size of {@link #DEFAULT_RETENTION_SIZE DEFAULT_RETENTION_SIZE} (100 entries). * * @param source the backing map to populate this {@code SoftHashMap} * @see #SoftHashMap(Map,int) */ public SoftHashMap(Map<K, V> source) { this(DEFAULT_RETENTION_SIZE); putAll(source); }
/** * Creates a {@code SoftHashMap} backed by the specified {@code source}, with the specified retention size. * <p/> * The retention size (n) is the total number of most recent entries in the map that will be strongly referenced * (ie 'retained') to prevent them from being eagerly garbage collected. That is, the point of a SoftHashMap is to * allow the garbage collector to remove as many entries from this map as it desires, but there will always be (n) * elements retained after a GC due to the strong references. * <p/> * Note that in a highly concurrent environments the exact total number of strong references may differ slightly * than the actual <code>retentionSize</code> value. This number is intended to be a best-effort retention low * water mark. * * @param source the backing map to populate this {@code SoftHashMap} * @param retentionSize the total number of most recent entries in the map that will be strongly referenced * (retained), preventing them from being eagerly garbage collected by the JVM. */ public SoftHashMap(Map<K, V> source, int retentionSize) { this(retentionSize); putAll(source); }
/** * Creates a {@code SoftHashMap} backed by the specified {@code source}, with the specified retention size. * <p/> * The retention size (n) is the total number of most recent entries in the map that will be strongly referenced * (ie 'retained') to prevent them from being eagerly garbage collected. That is, the point of a SoftHashMap is to * allow the garbage collector to remove as many entries from this map as it desires, but there will always be (n) * elements retained after a GC due to the strong references. * <p/> * Note that in a highly concurrent environments the exact total number of strong references may differ slightly * than the actual <code>retentionSize</code> value. This number is intended to be a best-effort retention low * water mark. * * @param source the backing map to populate this {@code SoftHashMap} * @param retentionSize the total number of most recent entries in the map that will be strongly referenced * (retained), preventing them from being eagerly garbage collected by the JVM. */ public SoftHashMap(Map<K, V> source, int retentionSize) { this(retentionSize); putAll(source); }