/libcore/support/src/test/java/tests/support/ |
H A D | Support_MapTest2.java | 25 Map<String, String> map; field in class:Support_MapTest2 29 map = m; 30 if (!map.isEmpty()) { 38 map.put("one", "1"); 39 assertEquals("size should be one", 1, map.size()); 40 map.clear(); 41 assertEquals("size should be zero", 0, map.size()); 42 assertTrue("Should not have entries", !map.entrySet().iterator() 44 assertTrue("Should not have keys", !map.keySet().iterator() 46 assertTrue("Should not have values", !map [all...] |
H A D | Support_UnmodifiableMapTest.java | 28 Map<String, Integer> map; field in class:Support_UnmodifiableMapTest 30 // must be a map containing the string keys "0"-"99" paired with the Integer 39 map = m; 45 assertTrue("UnmodifiableMapTest - Should contain the key \"0\"", map 47 assertTrue("UnmodifiableMapTest - Should contain the key \"50\"", map 50 !map.containsKey("100")); 53 assertTrue("UnmodifiableMapTest - Should contain the value 0", map 55 assertTrue("UnmodifiableMapTest - Should contain the value 50", map 57 assertTrue("UnmodifiableMapTest - Should not contain value 100", !map 61 Set<?> entrySet = map [all...] |
/libcore/benchmarks/src/benchmarks/ |
H A D | HashedCollectionsBenchmark.java | 33 HashMap<String, String> map = new HashMap<String, String>(); 34 map.put("hello", "world"); 36 map.get("hello"); 40 HashMap<String, String> map = new HashMap<String, String>(); 41 synchronized (map) { 42 map.put("hello", "world"); 45 synchronized (map) { 46 map.get("hello"); 51 Hashtable<String, String> map = new Hashtable<String, String>(); 52 map [all...] |
H A D | VirtualVersusInterfaceBenchmark.java | 32 Map<String, String> map = new HashMap<String, String>(); 34 map.put("hello", "world"); 38 HashMap<String, String> map = new HashMap<String, String>(); 40 map.put("hello", "world");
|
/libcore/luni/src/test/java/libcore/java/util/ |
H A D | OldAndroidHashMapTest.java | 29 private void addItems(HashMap<String, Integer> map) { argument 30 map.put("one", ONE); 31 map.put("two", TWO); 32 map.put("three", THREE); 33 map.put("four", FOUR); 35 assertEquals(4, map.size()); 37 assertEquals(ONE, map.get("one")); 38 assertEquals(TWO, map.get("two")); 39 assertEquals(THREE, map.get("three")); 40 assertEquals(FOUR, map [all...] |
H A D | TreeMapTest.java | 37 TreeMap<String, String> map = new TreeMap<String, String>(); 38 map.put("A", "a"); 39 map.put("B", "b"); 40 map.put("C", "c"); 42 Iterator<Entry<String, String>> iterator = map.entrySet().iterator(); 46 assertEquals("x", map.get("A")); 52 assertEquals("y", map.get("B")); 54 assertEquals("z", map.get("C")); 58 * Test that the entrySet() method of a sub map produces correctly mutable 59 * entries that propagate changes to the original map 116 assertAllEntryMethodsReturnImmutableEntries(NavigableMap<String, String> map) argument [all...] |
H A D | OldLinkedHashMapTest.java | 29 LinkedHashMap map = new LinkedHashMap<String, String>(10, 0.75f, true); 31 map.put("key1", "value1"); 32 map.put("key2", "value2"); 33 map.put("key3", "value3"); 35 Iterator iterator = map.keySet().iterator(); 37 map.get(id); 49 LinkedHashMap mapClone = (LinkedHashMap) map.clone(); 51 iterator = map.keySet().iterator();
|
H A D | EvilMapTest.java | 53 HashMap<String, String> map = new HashMap<String, String>(evil); 63 Hashtable<String, String> map = new Hashtable<String, String>(evil); 73 LinkedHashMap<String, String> map = new LinkedHashMap<String, String>(evil); 83 WeakHashMap<String, String> map = new WeakHashMap<String, String>(evil); 93 IdentityHashMap<String, String> map = new IdentityHashMap<String, String>(evil); 103 ConcurrentHashMap<String, String> map = new ConcurrentHashMap<String, String>(evil);
|
H A D | OldTreeMapTest.java | 140 assertTrue("New tree map does not answer correct comparator", 214 assertEquals("Returned map of incorrect size", 3, head.size()); 241 TreeMap<Integer, Double> map = new TreeMap<Integer, Double>( 243 map.put(1, 2.1); 244 map.put(2, 3.1); 245 map.put(3, 4.5); 246 map.put(7, 21.3); 247 map.put(null, null); 249 SortedMap<Integer, Double> smap = map.headMap(null); 421 SortedMap<String, String> map [all...] |
/libcore/luni/src/main/java/java/util/jar/ |
H A D | Attributes.java | 39 protected Map<Object, Object> map; field in class:Attributes 187 map = new HashMap<Object, Object>(); 199 map = (Map<Object, Object>) ((HashMap) attrib.map).clone(); 210 map = new HashMap<Object, Object>(size); 217 map.clear(); 228 return map.containsKey(key); 239 return map.containsValue(value); 243 * Returns a set containing map entries for each of the key/value pair 249 return map [all...] |
/libcore/luni/src/main/java/libcore/util/ |
H A D | BasicLruCache.java | 27 private final LinkedHashMap<K, V> map; field in class:BasicLruCache 35 this.map = new LinkedHashMap<K, V>(0, 0.75f, true); 49 V result = map.get(key); 57 map.put(key, result); 77 V previous = map.put(key, value); 83 while (map.size() > maxSize) { 84 Map.Entry<K, V> toEvict = map.eldest(); 88 map.remove(key); 114 return new LinkedHashMap<K, V>(map);
|
/libcore/luni/src/main/java/java/sql/ |
H A D | Array.java | 63 * @param map 64 * the map defining the correspondence between SQL type names 70 public Object getArray(long index, int count, Map<String, Class<?>> map) argument 76 * @param map 77 * the map defining the correspondence between SQL type names 83 public Object getArray(Map<String, Class<?>> map) throws SQLException; argument 141 * @param map 142 * the map defining the correspondence between SQL type names 150 Map<String, Class<?>> map) throws SQLException; 156 * @param map 149 getResultSet(long index, int count, Map<String, Class<?>> map) argument 163 getResultSet(Map<String, Class<?>> map) argument [all...] |
H A D | Ref.java | 62 * @param map 69 public Object getObject(Map<String, Class<?>> map) throws SQLException; argument
|
/libcore/luni/src/main/java/libcore/io/ |
H A D | Base64.java | 128 private static final byte[] map = new byte[] field in class:Base64 140 out[index++] = map[(in[i] & 0xff) >> 2]; 141 out[index++] = map[((in[i] & 0x03) << 4) | ((in[i+1] & 0xff) >> 4)]; 142 out[index++] = map[((in[i+1] & 0x0f) << 2) | ((in[i+2] & 0xff) >> 6)]; 143 out[index++] = map[(in[i+2] & 0x3f)]; 147 out[index++] = map[(in[end] & 0xff) >> 2]; 148 out[index++] = map[(in[end] & 0x03) << 4]; 153 out[index++] = map[(in[end] & 0xff) >> 2]; 154 out[index++] = map[((in[end] & 0x03) << 4) | ((in[end+1] & 0xff) >> 4)]; 155 out[index++] = map[((i [all...] |
/libcore/luni/src/main/java/org/apache/harmony/security/asn1/ |
H A D | ASN1Choice.java | 65 * So a custom ASN.1 Time choice type should map its notation to Date object. 235 // create map of all identifiers 236 TreeMap<BigInteger, BigInteger> map = new TreeMap<BigInteger, BigInteger>(); 249 addIdentifier(map, choiceToAdd[0][j], index); 256 addIdentifier(map, t.id, index); 261 addIdentifier(map, t.constrId, index); 266 int size = map.size(); 268 Iterator<Map.Entry<BigInteger, BigInteger>> it = map.entrySet().iterator(); 281 private void addIdentifier(TreeMap<BigInteger, BigInteger> map, int identifier, int index){ argument 282 if (map [all...] |
/libcore/luni/src/main/java/java/net/ |
H A D | CookieStoreImpl.java | 31 /** this map may have null keys! */ 32 private final Map<URI, List<HttpCookie>> map = new HashMap<URI, List<HttpCookie>>(); field in class:CookieStoreImpl 40 List<HttpCookie> cookies = map.get(uri); 43 map.put(uri, cookies); 69 List<HttpCookie> cookiesForUri = map.get(uri); 82 for (Map.Entry<URI, List<HttpCookie>> entry : map.entrySet()) { 106 for (List<HttpCookie> list : map.values()) { 120 List<URI> result = new ArrayList<URI>(map.keySet()); 130 List<HttpCookie> cookies = map.get(cookiesUri(uri)); 139 boolean result = !map [all...] |
/libcore/dom/src/test/java/org/w3c/domts/level2/core/ |
H A D | setNamedItemNS01.java | 40 * Invoke method setNamedItemNS(arg) on the map of the first "address" element with 83 NamedNodeMap map; 91 map = testAddress.getAttributes(); 96 setNode = map.setNamedItemNS(arg);
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/nio/tests/java/nio/ |
H A D | MappedByteBufferTest.java | 47 MappedByteBuffer mmb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc 68 * Regression for HARMONY-6315 - FileChannel.map throws IOException 77 MappedByteBuffer mmb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size()); 104 mmb = fc.map(FileChannel.MapMode.READ_WRITE, 0, fc.size()); 113 mmb = fc.map(FileChannel.MapMode.PRIVATE, 0, fc.size()); 130 MappedByteBuffer mmbRead = fileChannelRead.map(MapMode.READ_ONLY, 0, 137 MappedByteBuffer resultRead = fileChannelR.map(MapMode.READ_ONLY, 0, 148 MappedByteBuffer mmbReadWrite = fileChannelReadWrite.map( 156 MappedByteBuffer resultReadWrite = fileChannelRW.map( 174 MappedByteBuffer mmbRead = fileChannelRead.map(MapMod [all...] |
/libcore/luni/src/test/java/tests/api/java/util/ |
H A D | IdentityHashMapTest.java | 140 IdentityHashMap map = new IdentityHashMap(); 141 map.put("key", "value"); 143 Set keys = map.keySet(); 144 Collection values = map.values(); 149 AbstractMap map2 = (AbstractMap) map.clone(); 153 // values() and keySet() on the cloned() map should be different 235 assertTrue("Returned false for new map", new IdentityHashMap() 257 Map map = new IdentityHashMap(101); 258 map.put(new Integer(1), "1"); 259 map [all...] |
H A D | HashMapTest.java | 146 HashMap map = new HashMap(); 147 map.put("key", "value"); 149 Set keys = map.keySet(); 150 Collection values = map.values(); 155 AbstractMap map2 = (AbstractMap) map.clone(); 159 // values() and keySet() on the cloned() map should be different 268 HashMap map = new HashMap(); 270 map.put(k, "value1"); 273 assertNull(map.get(k)); 276 assertNull(map [all...] |
H A D | WeakHashMapTest.java | 126 WeakHashMap map = new WeakHashMap(mockMap); 127 assertEquals("Size should be 0", 0, map.size()); 146 assertTrue("Cleared map should be empty", whm.isEmpty()); 148 assertNull("Cleared map should only return null", whm 199 assertTrue("Invalid map entry returned--bad key", keys 201 assertTrue("Invalid map entry returned--bad key", values 227 assertTrue("New map should be empty", whm.isEmpty()); 241 WeakHashMap map = new WeakHashMap(); 242 map.put(null, "value"); // add null key 246 map [all...] |
H A D | AbstractMapTest.java | 168 private Map map = new HashMap(); 171 return map.entrySet(); 175 return map.put(key, value); 179 return map; 191 MyMap map = new MyMap(); 192 map.put("one", "1"); 193 Map.Entry entry = (Map.Entry) map.entrySet().iterator().next(); 196 MyMap mapClone = (MyMap) map.clone(); 197 assertTrue("clone not shallow", map.getMap() == mapClone.getMap());
|
/libcore/luni/src/main/java/java/lang/ |
H A D | System.java | 214 * Returns an unmodifiable map of all environment variables to their values. 217 Map<String, String> map = new HashMap<String, String>(); 221 map.put(entry.substring(0, index), entry.substring(index + 1)); 224 return new SystemEnvironment(map); 645 * The unmodifiable environment variables map. System.getenv() specifies 646 * that this map must throw when passed non-String keys. 649 private final Map<String, String> map; field in class:System.SystemEnvironment 651 public SystemEnvironment(Map<String, String> map) { argument 652 this.map = Collections.unmodifiableMap(map); [all...] |
/libcore/luni/src/main/java/java/util/ |
H A D | IdentityHashMap.java | 58 * maximum number of elements that can be put in this map before having to 81 * map. 86 private final IdentityHashMap<K,V> map; field in class:IdentityHashMap.IdentityHashMapEntry 88 IdentityHashMapEntry(IdentityHashMap<K,V> map, K theKey, V theValue) { argument 90 this.map = map; 124 map.put(key, object); 261 * this map. 297 * Creates an IdentityHashMap using the given map as initial values. 299 * @param map 302 IdentityHashMap(Map<? extends K, ? extends V> map) argument 502 putAll(Map<? extends K, ? extends V> map) argument 819 putAllImpl(Map<? extends K, ? extends V> map) argument [all...] |
H A D | Map.java | 99 * @return {@code true} if this map contains the specified key, 109 * @return {@code true} if this map contains the specified value, 156 * Returns whether this map is empty. 158 * @return {@code true} if this map has no elements, {@code false} 198 * @param map 211 public void putAll(Map<? extends K,? extends V> map); argument 250 * @return a collection of the values contained in this map.
|