@Test public void testContainsValue(){ Assert.assertFalse(byteMap.containsValue("Example0", false)); Assert.assertFalse(byteMap.containsValue("Example34", false)); Assert.assertFalse(byteMap.containsValue("NewExample123", false)); Assert.assertFalse(byteMap.containsValue("ThisValueShouldNotBePresent", false)); testAdd(); Assert.assertTrue(byteMap.containsValue("Example0", false)); Assert.assertTrue(byteMap.containsValue("Example34", false)); Assert.assertTrue(byteMap.containsValue("NewExample123", false)); Assert.assertFalse(byteMap.containsValue("ThisValueShouldNotBePresent", false)); byteMap.clear(); Assert.assertFalse(byteMap.containsValue("Example0", false)); Assert.assertFalse(byteMap.containsValue("Example34", false)); Assert.assertFalse(byteMap.containsValue("NewExample123", false)); Assert.assertFalse(byteMap.containsValue("ThisValueShouldNotBePresent", false)); }
public boolean containsValue (Object value, boolean identity) { V[] valueTable = this.valueTable; if (value == null) { if (hasZeroValue && zeroValue == null) return true; byte[] keyTable = this.keyTable; for (int i = capacity + stashSize; i-- > 0;) if (keyTable[i] != EMPTY && valueTable[i] == null) return true; } else if (identity) { if (value == zeroValue) return true; for (int i = capacity + stashSize; i-- > 0;) if (valueTable[i] == value) return true; } else { if (hasZeroValue && value.equals(zeroValue)) return true; for (int i = capacity + stashSize; i-- > 0;) if (value.equals(valueTable[i])) return true; } return false; }
ByteMap implements Iterable<ByteMap.Entry<V>> { public boolean containsValue (Object value, boolean identity) { V[] valueTable = this.valueTable; if (value == null) { if (hasZeroValue && zeroValue == null) return true; byte[] keyTable = this.keyTable; for (int i = capacity + stashSize; i-- > 0;) if (keyTable[i] != EMPTY && valueTable[i] == null) return true; } else if (identity) { if (value == zeroValue) return true; for (int i = capacity + stashSize; i-- > 0;) if (valueTable[i] == value) return true; } else { if (hasZeroValue && value.equals(zeroValue)) return true; for (int i = capacity + stashSize; i-- > 0;) if (value.equals(valueTable[i])) return true; } return false; } }
ByteMap implements Iterable<ByteMap.Entry<V>> { public boolean containsValue (Object value, boolean identity) { V[] valueTable = this.valueTable; if (value == null) { if (hasZeroValue && zeroValue == null) return true; byte[] keyTable = this.keyTable; for (int i = capacity + stashSize; i-- > 0;) if (keyTable[i] != EMPTY && valueTable[i] == null) return true; } else if (identity) { if (value == zeroValue) return true; for (int i = capacity + stashSize; i-- > 0;) if (valueTable[i] == value) return true; } else { if (hasZeroValue && value.equals(zeroValue)) return true; for (int i = capacity + stashSize; i-- > 0;) if (value.equals(valueTable[i])) return true; } return false; } ByteMap();  ByteMap(int initialCapacity);  ByteMap(int initialCapacity, float loadFactor);  ByteMap(ByteMap<? extends V> map); }
ByteMap implements Iterable<ByteMap.Entry<V>> { public boolean containsValue (Object value, boolean identity) { V[] valueTable = this.valueTable; if (value == null) { if (hasZeroValue && zeroValue == null) return true; byte[] keyTable = this.keyTable; for (int i = capacity + stashSize; i-- > 0;) if (keyTable[i] != EMPTY && valueTable[i] == null) return true; } else if (identity) { if (value == zeroValue) return true; for (int i = capacity + stashSize; i-- > 0;) if (valueTable[i] == value) return true; } else { if (hasZeroValue && value.equals(zeroValue)) return true; for (int i = capacity + stashSize; i-- > 0;) if (value.equals(valueTable[i])) return true; } return false; } ByteMap();  ByteMap(int initialCapacity);  ByteMap(int initialCapacity, float loadFactor);  ByteMap(ByteMap<? extends V> map); V put(byte key, V value); void putAll(ByteMap<V> map); V get(byte key); V get(byte key, V defaultValue); V remove(byte key); void shrink(int maximumCapacity); void clear(int maximumCapacity); void clear(); boolean containsValue(Object value, boolean identity); boolean containsKey(byte key); byte findKey(Object value, boolean identity, byte notFound); void ensureCapacity(int additionalCapacity); int hashCode(); boolean equals(Object obj); String toString(); Iterator<Entry<V>> iterator(); Entries<V> entries(); Values<V> values(); Keys keys(); }
ByteMap implements Iterable<ByteMap.Entry<V>> { public boolean containsValue (Object value, boolean identity) { V[] valueTable = this.valueTable; if (value == null) { if (hasZeroValue && zeroValue == null) return true; byte[] keyTable = this.keyTable; for (int i = capacity + stashSize; i-- > 0;) if (keyTable[i] != EMPTY && valueTable[i] == null) return true; } else if (identity) { if (value == zeroValue) return true; for (int i = capacity + stashSize; i-- > 0;) if (valueTable[i] == value) return true; } else { if (hasZeroValue && value.equals(zeroValue)) return true; for (int i = capacity + stashSize; i-- > 0;) if (value.equals(valueTable[i])) return true; } return false; } ByteMap();  ByteMap(int initialCapacity);  ByteMap(int initialCapacity, float loadFactor);  ByteMap(ByteMap<? extends V> map); V put(byte key, V value); void putAll(ByteMap<V> map); V get(byte key); V get(byte key, V defaultValue); V remove(byte key); void shrink(int maximumCapacity); void clear(int maximumCapacity); void clear(); boolean containsValue(Object value, boolean identity); boolean containsKey(byte key); byte findKey(Object value, boolean identity, byte notFound); void ensureCapacity(int additionalCapacity); int hashCode(); boolean equals(Object obj); String toString(); Iterator<Entry<V>> iterator(); Entries<V> entries(); Values<V> values(); Keys keys(); public int size; }