boolean keySpecialEquals(HashObjByteMapFactory<?> other) { return getKeyEquivalence().equals(other.getKeyEquivalence()) && isNullKeyAllowed() == other.isNullKeyAllowed(); }
/** * Constructs a new empty mutable map of the default expected size. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjByteMapFactory#newMutableMap() newMutableMap()}. * * @param <K> the key type of the returned map * @return a new empty mutable map */ @Nonnull public static <K> HashObjByteMap<K> newMutableMap() { return getDefaultFactory().newMutableMap(); }
/** * Constructs a new immutable map with the same mappings as the specified {@code map}. * * * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjByteMapFactory#newImmutableMap( * Map) newImmutableMap(map)}. * * @param map the map whose mappings are to be placed in the returned map * * @param <K> the key type of the returned map * @return a new immutable map with the same mappings as the specified {@code map} */ @Nonnull public static <K> HashObjByteMap<K> newImmutableMap( @Nonnull Map<? extends K, Byte> map) { return getDefaultFactory().newImmutableMap(map); }
public PatternAggregationStorage(String name) { super(name); reservations = HashObjByteMaps.getDefaultFactory().withDefaultValue((byte) 0).newMutableMap(); quick2CanonicalMap = new ConcurrentHashMap<>(); }
/** * Constructs a new empty updatable map of the default expected size. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjByteMapFactory#newUpdatableMap() newUpdatableMap()}. * * @param <K> the key type of the returned map * @return a new empty updatable map */ @Nonnull public static <K> HashObjByteMap<K> newUpdatableMap() { return getDefaultFactory().newUpdatableMap(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj instanceof HashObjByteMapFactory) { HashObjByteMapFactory factory = (HashObjByteMapFactory) obj; return commonEquals(factory) && keySpecialEquals(factory) && // boxing to treat NaNs correctly ((Byte) getDefaultValue()).equals(factory.getDefaultValue()) ; } else { return false; } }
/** * Constructs a new mutable map of the single specified mapping. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjByteMapFactory#newMutableMapOf(Object, byte * ) newMutableMapOf(k1, v1)}. * * @param k1 the key of the sole mapping * @param v1 the value of the sole mapping * @param <K> the key type of the returned map * @return a new mutable map of the single specified mapping */ @Nonnull public static <K> HashObjByteMap<K> newMutableMapOf( K k1, byte v1) { return getDefaultFactory().newMutableMapOf(k1, v1); }
/** * Constructs a new updatable map of the single specified mapping. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjByteMapFactory#newUpdatableMapOf(Object, byte * ) newUpdatableMapOf(k1, v1)}. * * @param k1 the key of the sole mapping * @param v1 the value of the sole mapping * @param <K> the key type of the returned map * @return a new updatable map of the single specified mapping */ @Nonnull public static <K> HashObjByteMap<K> newUpdatableMapOf( K k1, byte v1) { return getDefaultFactory().newUpdatableMapOf(k1, v1); }
/** * Constructs a new immutable map of the single specified mapping. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjByteMapFactory#newImmutableMapOf(Object, byte * ) newImmutableMapOf(k1, v1)}. * * @param k1 the key of the sole mapping * @param v1 the value of the sole mapping * @param <K> the key type of the returned map * @return a new immutable map of the single specified mapping */ @Nonnull public static <K> HashObjByteMap<K> newImmutableMapOf( K k1, byte v1) { return getDefaultFactory().newImmutableMapOf(k1, v1); }
/** * Constructs a new empty updatable map of the given expected size. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjByteMapFactory#newUpdatableMap(int) newUpdatableMap(expectedSize)}. * * @param expectedSize the expected size of the returned map * @param <K> the key type of the returned map * @return a new empty updatable map of the given expected size */ @Nonnull public static <K> HashObjByteMap<K> newUpdatableMap(int expectedSize) { return getDefaultFactory().newUpdatableMap(expectedSize); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj instanceof HashObjByteMapFactory) { HashObjByteMapFactory factory = (HashObjByteMapFactory) obj; return commonEquals(factory) && keySpecialEquals(factory) && // boxing to treat NaNs correctly ((Byte) getDefaultValue()).equals(factory.getDefaultValue()) ; } else { return false; } }
/** * Constructs a new mutable map of the two specified mappings. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjByteMapFactory#newMutableMapOf(Object, byte, * Object, byte) newMutableMapOf(k1, v1, k2, v2)}. * * @param k1 the key of the first mapping * @param v1 the value of the first mapping * @param k2 the key of the second mapping * @param v2 the value of the second mapping * @param <K> the key type of the returned map * @return a new mutable map of the two specified mappings */ @Nonnull public static <K> HashObjByteMap<K> newMutableMapOf( K k1, byte v1, K k2, byte v2) { return getDefaultFactory().newMutableMapOf(k1, v1, k2, v2); }
/** * Constructs a new updatable map of the two specified mappings. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjByteMapFactory#newUpdatableMapOf(Object, byte, * Object, byte) newUpdatableMapOf(k1, v1, k2, v2)}. * * @param k1 the key of the first mapping * @param v1 the value of the first mapping * @param k2 the key of the second mapping * @param v2 the value of the second mapping * @param <K> the key type of the returned map * @return a new updatable map of the two specified mappings */ @Nonnull public static <K> HashObjByteMap<K> newUpdatableMapOf( K k1, byte v1, K k2, byte v2) { return getDefaultFactory().newUpdatableMapOf(k1, v1, k2, v2); }
/** * Constructs a new immutable map of the two specified mappings. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjByteMapFactory#newImmutableMapOf(Object, byte, * Object, byte) newImmutableMapOf(k1, v1, k2, v2)}. * * @param k1 the key of the first mapping * @param v1 the value of the first mapping * @param k2 the key of the second mapping * @param v2 the value of the second mapping * @param <K> the key type of the returned map * @return a new immutable map of the two specified mappings */ @Nonnull public static <K> HashObjByteMap<K> newImmutableMapOf( K k1, byte v1, K k2, byte v2) { return getDefaultFactory().newImmutableMapOf(k1, v1, k2, v2); }
/** * Constructs a new empty mutable map of the given expected size. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjByteMapFactory#newMutableMap(int) newMutableMap(expectedSize)}. * * @param expectedSize the expected size of the returned map * @param <K> the key type of the returned map * @return a new empty mutable map of the given expected size */ @Nonnull public static <K> HashObjByteMap<K> newMutableMap(int expectedSize) { return getDefaultFactory().newMutableMap(expectedSize); }
boolean keySpecialEquals(HashObjByteMapFactory<?> other) { return getKeyEquivalence().equals(other.getKeyEquivalence()) && isNullKeyAllowed() == other.isNullKeyAllowed(); }
/** * Constructs a new updatable map with the same mappings as the specified {@code map}. * * * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjByteMapFactory#newUpdatableMap( * Map) newUpdatableMap(map)}. * * @param map the map whose mappings are to be placed in the returned map * * @param <K> the key type of the returned map * @return a new updatable map with the same mappings as the specified {@code map} */ @Nonnull public static <K> HashObjByteMap<K> newUpdatableMap( @Nonnull Map<? extends K, Byte> map) { return getDefaultFactory().newUpdatableMap(map); }
/** * Constructs a new immutable map filled with mappings consumed by the callback within the given * closure. Mappings supplied later within the closure have priority over the mappings * passed earlier with the same keys. * * <p>Example: TODO * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjByteMapFactory#newImmutableMap( * Consumer) newImmutableMap(entriesSupplier)}. * * @param entriesSupplier the function which supply mappings for the returned map via * the callback passed in * * @param <K> the key type of the returned map * @return a new immutable map with mappings consumed by the callback within the given closure */ @Nonnull public static <K> HashObjByteMap<K> newImmutableMap(@Nonnull Consumer<net.openhft.koloboke.function.ObjByteConsumer<K>> entriesSupplier ) { return getDefaultFactory().newImmutableMap(entriesSupplier); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj instanceof HashObjByteMapFactory) { HashObjByteMapFactory factory = (HashObjByteMapFactory) obj; return commonEquals(factory) && keySpecialEquals(factory) && // boxing to treat NaNs correctly ((Byte) getDefaultValue()).equals(factory.getDefaultValue()) ; } else { return false; } }
/** * Constructs a new mutable map of the three specified mappings. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjByteMapFactory#newMutableMapOf(Object, byte, * Object, byte, Object, byte) newMutableMapOf(k1, v1, k2, v2, * k3, v3)}. * * @param k1 the key of the first mapping * @param v1 the value of the first mapping * @param k2 the key of the second mapping * @param v2 the value of the second mapping * @param k3 the key of the third mapping * @param v3 the value of the third mapping * @param <K> the key type of the returned map * @return a new mutable map of the three specified mappings */ @Nonnull public static <K> HashObjByteMap<K> newMutableMapOf( K k1, byte v1, K k2, byte v2, K k3, byte v3) { return getDefaultFactory().newMutableMapOf(k1, v1, k2, v2, k3, v3); }