/** * Create a flyweight vector with a key set and value function. * @param keys The key set. * @param valueFunc Function to compute keys from values. * @return The flyweight map. */ public static Long2DoubleMap flyweightMap(LongSet keys, LongToDoubleFunction valueFunc) { return new FlyweightLong2DoubleMap(keys, valueFunc); }
@Override public double get(long key) { return getOrDefault(key, defaultReturnValue()); }
@Override public double get(long key) { return getOrDefault(key, defaultReturnValue()); }
/** * Create a flyweight vector with a key set and value function. * @param keys The key set. * @param valueFunc Function to compute keys from values. * @return The flyweight map. */ public static Long2DoubleMap flyweightMap(LongSet keys, LongToDoubleFunction valueFunc) { return new FlyweightLong2DoubleMap(keys, valueFunc); }