/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_MapTest.java | 31 // must be a map containing the string keys "0"-"99" paired with the Integer 48 new Support_UnmodifiableCollectionTest("values() from map test", modifiableMap.values()) 50 new Support_UnmodifiableCollectionTest("values() from unmodifiable map test", 60 private void testContents(Map<String, Integer> map) { argument 62 assertTrue("Size should return 100, returned: " + map.size(), map.size() == 100); 65 assertTrue("Should contain the key \"0\"", map.containsKey("0")); 66 assertTrue("Should contain the key \"50\"", map.containsKey("50")); 67 assertTrue("Should not contain the key \"100\"", !map.containsKey("100")); 70 assertTrue("Should contain the value 0", map [all...] |
/libcore/luni/src/test/java/libcore/java/net/ |
H A D | OldFileNameMapTest.java | 26 FileNameMap map = URLConnection.getFileNameMap(); 27 assertEquals("text/plain", map.getContentTypeFor("test.text")); 28 assertEquals("text/plain", map.getContentTypeFor("test.txt")); 29 assertEquals("text/html", map.getContentTypeFor("test.htm")); 30 assertEquals("text/html", map.getContentTypeFor("test.html"));
|
/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();
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/ |
H A D | SortedMapTestBase.java | 43 SortedMap<Integer, Integer> map; field in class:SortedMapTestBase 56 map.clear(); 57 assertTrue(map.isEmpty()); 63 assertEquals(ref.containsKey(key), map.containsKey(key)); 71 assertEquals(ref.containsValue(value), map.containsValue(value)); 78 Set<Map.Entry<Integer, Integer>> mapSet = map.entrySet(); 85 assertEquals(ref.entrySet(), map.entrySet()); 92 assertEquals(ref.get(key), map.get(key)); 98 assertEquals(ref.keySet(), map.keySet()); 100 Iterator<Integer> j = map 291 checkSubMap(SortedMap<Integer, Integer> ref, SortedMap<Integer, Integer> map) argument 324 testViews(SortedMap<Integer, Integer> ref, SortedMap<Integer, Integer> map) argument 336 compareIterators(Collection ref, Collection map) argument [all...] |
H A D | AbstractMapTest.java | 142 AbstractMap map = new HashMap(); 143 map.put(1, 1); 144 map.clear(); 145 assertTrue(map.isEmpty()); 175 AbstractMap map = new AMT(); 177 assertFalse(map.containsKey("k")); 178 assertFalse(map.containsKey(null)); 180 map.put("k", "v"); 181 map.put("key", null); 182 map [all...] |
H A D | IdentityHashMapTest.java | 141 IdentityHashMap map = new IdentityHashMap(); 142 map.put("key", "value"); 144 Set keys = map.keySet(); 145 Collection values = map.values(); 150 AbstractMap map2 = (AbstractMap) map.clone(); 154 // values() and keySet() on the cloned() map should be different 236 assertTrue("Returned false for new map", new IdentityHashMap() 258 Map map = new IdentityHashMap(101); 259 map.put(new Integer(1), "1"); 260 map [all...] |
H A D | TreeMapRndTest.java | 26 map = new TreeMap<Integer, Integer>(ref);
|
/libcore/jsr166-tests/src/test/java/jsr166/ |
H A D | TreeSubMapTest.java | 15 * Returns a new map from Integers 1-5 to Strings "A"-"E". 18 TreeMap map = new TreeMap(); 19 assertTrue(map.isEmpty()); 20 map.put(zero, "Z"); 21 map.put(one, "A"); 22 map.put(five, "E"); 23 map.put(three, "C"); 24 map.put(two, "B"); 25 map.put(four, "D"); 26 map [all...] |
H A D | ConcurrentSkipListMapTest.java | 16 * Returns a new map from Integers 1-5 to Strings "A"-"E". 19 ConcurrentSkipListMap map = new ConcurrentSkipListMap(); 20 assertTrue(map.isEmpty()); 21 map.put(one, "A"); 22 map.put(five, "E"); 23 map.put(three, "C"); 24 map.put(two, "B"); 25 map.put(four, "D"); 26 assertFalse(map.isEmpty()); 27 assertEquals(5, map 990 populate(NavigableMap<Integer, Integer> map, int limit) argument 997 mutateMap(NavigableMap<Integer, Integer> map, int min, int max) argument 1022 mutateSubMap(NavigableMap<Integer, Integer> map, int min, int max) argument 1053 put(NavigableMap<Integer, Integer> map, int key) argument 1058 remove(NavigableMap<Integer, Integer> map, int key) argument 1063 bashSubMap(NavigableMap<Integer, Integer> map, int min, int max, boolean ascending) argument 1144 check(NavigableMap<Integer, Integer> map, final int min, final int max, final boolean ascending) argument [all...] |
H A D | ConcurrentSkipListSubMapTest.java | 17 * Returns a new map from Integers 1-5 to Strings "A"-"E". 20 ConcurrentSkipListMap map = new ConcurrentSkipListMap(); 21 assertTrue(map.isEmpty()); 22 map.put(zero, "Z"); 23 map.put(one, "A"); 24 map.put(five, "E"); 25 map.put(three, "C"); 26 map.put(two, "B"); 27 map.put(four, "D"); 28 map [all...] |
H A D | ConcurrentHashMapTest.java | 18 * Returns a new map from Integers 1-5 to Strings "A"-"E". 21 ConcurrentHashMap map = new ConcurrentHashMap(5); 22 assertTrue(map.isEmpty()); 23 map.put(one, "A"); 24 map.put(two, "B"); 25 map.put(three, "C"); 26 map.put(four, "D"); 27 map.put(five, "E"); 28 assertFalse(map.isEmpty()); 29 assertEquals(5, map [all...] |
H A D | TreeMapTest.java | 15 * Returns a new map from Integers 1-5 to Strings "A"-"E". 18 TreeMap map = new TreeMap(); 19 assertTrue(map.isEmpty()); 20 map.put(one, "A"); 21 map.put(five, "E"); 22 map.put(three, "C"); 23 map.put(two, "B"); 24 map.put(four, "D"); 25 assertFalse(map.isEmpty()); 26 assertEquals(5, map 795 populate(NavigableMap<Integer, Integer> map, int limit) argument 802 mutateMap(NavigableMap<Integer, Integer> map, int min, int max) argument 827 mutateSubMap(NavigableMap<Integer, Integer> map, int min, int max) argument 858 put(NavigableMap<Integer, Integer> map, int key) argument 863 remove(NavigableMap<Integer, Integer> map, int key) argument 868 bashSubMap(NavigableMap<Integer, Integer> map, int min, int max, boolean ascending) argument 949 check(NavigableMap<Integer, Integer> map, final int min, final int max, final boolean ascending) argument [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/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/ |
H A D | CookieManagerTest.java | 36 Map<String, List<String>> map) throws IOException { 39 manager.get(uri, map); 48 Map<String, List<String>> map) throws IOException { 51 manager.put(uri, map); 147 Map<String, List<String>> map = manager.get(new URI("http://a.b.c/"), 150 assertEquals(1, map.size()); 151 List<String> list = map.get("Cookie"); 155 map = manager.get(new URI("http://a.b.c/te"), dummyMap); 156 list = map.get("Cookie"); 166 map 35 checkValidParams4Get(URI uri, Map<String, List<String>> map) argument 47 checkValidParams4Put(URI uri, Map<String, List<String>> map) argument [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...] |