Lines Matching refs:strategy
44 * instance. Client libraries implement {@link Strategy}, and this class
74 * <p>For example, the following strategy emulates the behavior of
79 * implements CustomConcurrentHashMap.Strategy<K, V,
119 * To create a {@link java.util.concurrent.ConcurrentMap} using the strategy
197 * Creates a new concurrent hash map backed by the given strategy.
199 * @param strategy used to implement and manipulate the entries
205 * @throws NullPointerException if strategy is null
207 public <K, V, E> ConcurrentMap<K, V> buildMap(Strategy<K, V, E> strategy) {
208 if (strategy == null) {
209 throw new NullPointerException("strategy");
211 return new Impl<K, V, E>(strategy, this);
215 * Creates a {@link ConcurrentMap}, backed by the given strategy, that
242 * @param strategy used to implement and manipulate the entries
249 * @throws NullPointerException if strategy or computer is null
252 ComputingStrategy<K, V, E> strategy,
254 if (strategy == null) {
255 throw new NullPointerException("strategy");
261 return new ComputingImpl<K, V, E>(strategy, this, computer);
292 * example. Strategy implementations should proactively remove partially
301 public interface Strategy<K, V, E> {
394 * that was provided to {@link Strategy#newEntry} when the given entry was
398 * {@link Strategy#newEntry}
403 * Returns the hash code that was passed to {@link Strategy#newEntry})
410 // * Notifies the strategy that an entry has been removed from the map.
418 * entries to this strategy
470 * Extends {@link Strategy} to add support for computing values on-demand.
483 public interface ComputingStrategy<K, V, E> extends Strategy<K, V, E> {
540 * The basic strategy is to subdivide the table among Segments,
570 * The strategy used to implement this map.
572 final Strategy<K, V, E> strategy;
592 * Creates a new, empty map with the specified strategy, initial capacity,
595 Impl(Strategy<K, V, E> strategy, Builder builder) {
631 this.strategy = strategy;
633 strategy.setInternals(new InternalsImpl());
637 int h = strategy.hashKey(key);
657 int hash = strategy.getHash(entry);
665 int hash = strategy.getHash(entry);
792 Strategy<K, V, E> s = Impl.this.strategy;
819 return strategy.getValue(entry);
823 Strategy<K, V, E> s = Impl.this.strategy;
846 Strategy<K, V, E> s = Impl.this.strategy;
871 Strategy<K, V, E> s = Impl.this.strategy;
899 Strategy<K, V, E> s = Impl.this.strategy;
925 Strategy<K, V, E> s = Impl.this.strategy;
993 Strategy<K, V, E> s = Impl.this.strategy;
1043 Strategy<K, V, E> s = Impl.this.strategy;
1055 V entryValue = strategy.getValue(e);
1082 Strategy<K, V, E> s = Impl.this.strategy;
1094 V entryValue = strategy.getValue(e);
1126 Strategy<K, V, E> s = Impl.this.strategy;
1168 Strategy<K, V, E> s = Impl.this.strategy;
1663 Strategy<K, V, E> s = Impl.this.strategy;
1695 Strategy<K, V, E> s = Impl.this.strategy;
1857 return v != null && strategy.equalValues(v, e.getValue());
1890 out.writeObject(strategy);
1908 static final Field strategy = findField("strategy");
1927 Strategy<K, V, E> strategy = (Strategy<K, V, E>) in.readObject();
1961 Fields.strategy.set(this, strategy);
1985 * Creates a new, empty map with the specified strategy, initial capacity,
1988 ComputingImpl(ComputingStrategy<K, V, E> strategy, Builder builder,
1990 super(strategy, builder);
1991 this.computingStrategy = strategy;
2086 * A basic, no-frills implementation of {@code Strategy} using {@link
2105 implements Strategy<K, V, SimpleInternalEntry<K, V>> {