Home
last modified time | relevance | path

Searched refs:map (Results 1 – 25 of 200) sorted by relevance

12345678

/libcore/luni/src/test/java/libcore/java/util/
DOldAndroidHashMapTest.java29 private void addItems(HashMap<String, Integer> map) { in addItems() argument
30 map.put("one", ONE); in addItems()
31 map.put("two", TWO); in addItems()
32 map.put("three", THREE); in addItems()
33 map.put("four", FOUR); in addItems()
35 assertEquals(4, map.size()); in addItems()
37 assertEquals(ONE, map.get("one")); in addItems()
38 assertEquals(TWO, map.get("two")); in addItems()
39 assertEquals(THREE, map.get("three")); in addItems()
40 assertEquals(FOUR, map.get("four")); in addItems()
[all …]
DTreeMapTest.java45 TreeMap<String, String> map = new TreeMap<String, String>(); in testEntrySetSetValue() local
46 map.put("A", "a"); in testEntrySetSetValue()
47 map.put("B", "b"); in testEntrySetSetValue()
48 map.put("C", "c"); in testEntrySetSetValue()
50 Iterator<Entry<String, String>> iterator = map.entrySet().iterator(); in testEntrySetSetValue()
54 assertEquals("x", map.get("A")); in testEntrySetSetValue()
60 assertEquals("y", map.get("B")); in testEntrySetSetValue()
62 assertEquals("z", map.get("C")); in testEntrySetSetValue()
70 TreeMap<String, String> map = new TreeMap<String, String>(); in testSubMapEntrySetSetValue() local
71 map.put("A", "a"); in testSubMapEntrySetSetValue()
[all …]
DCollectionsTest.java293 NavigableMap<String, Integer> map = checkedNavigableMap( in test_checkedNavigableMap_replaceAll() local
296 map.replaceAll((k, v) -> 5 * v); in test_checkedNavigableMap_replaceAll()
299 map); in test_checkedNavigableMap_replaceAll()
303 NavigableMap<Integer, Double> map = in test_checkedNavigableMap_putIfAbsent() local
305 MapDefaultMethodTester.test_putIfAbsent(map, in test_checkedNavigableMap_putIfAbsent()
310 NavigableMap<Integer, Double> map = in test_checkedNavigableMap_remove() local
312 MapDefaultMethodTester.test_remove(map, in test_checkedNavigableMap_remove()
317 NavigableMap<Integer, Double> map = in test_checkedNavigableMap_replace$K$V() local
319 MapDefaultMethodTester.test_replace$K$V$V(map, in test_checkedNavigableMap_replace$K$V()
324 NavigableMap<Integer, Double> map = in test_checkedNavigableMap_replace$K$V$V() local
[all …]
/libcore/jsr166-tests/src/test/java/jsr166/
DConcurrentSkipListSubMapTest.java38 ConcurrentSkipListMap map = new ConcurrentSkipListMap(); in map5() local
39 assertTrue(map.isEmpty()); in map5()
40 map.put(zero, "Z"); in map5()
41 map.put(one, "A"); in map5()
42 map.put(five, "E"); in map5()
43 map.put(three, "C"); in map5()
44 map.put(two, "B"); in map5()
45 map.put(four, "D"); in map5()
46 map.put(seven, "F"); in map5()
47 assertFalse(map.isEmpty()); in map5()
[all …]
DTreeSubMapTest.java37 TreeMap map = new TreeMap(); in map5() local
38 assertTrue(map.isEmpty()); in map5()
39 map.put(zero, "Z"); in map5()
40 map.put(one, "A"); in map5()
41 map.put(five, "E"); in map5()
42 map.put(three, "C"); in map5()
43 map.put(two, "B"); in map5()
44 map.put(four, "D"); in map5()
45 map.put(seven, "F"); in map5()
46 assertFalse(map.isEmpty()); in map5()
[all …]
DConcurrentSkipListMapTest.java40 ConcurrentSkipListMap map = new ConcurrentSkipListMap(); in map5() local
41 assertTrue(map.isEmpty()); in map5()
42 map.put(one, "A"); in map5()
43 map.put(five, "E"); in map5()
44 map.put(three, "C"); in map5()
45 map.put(two, "B"); in map5()
46 map.put(four, "D"); in map5()
47 assertFalse(map.isEmpty()); in map5()
48 assertEquals(5, map.size()); in map5()
49 return map; in map5()
[all …]
DConcurrentHashMapTest.java40 ConcurrentHashMap map = new ConcurrentHashMap<Integer, String>(5); in map5() local
41 assertTrue(map.isEmpty()); in map5()
42 map.put(one, "A"); in map5()
43 map.put(two, "B"); in map5()
44 map.put(three, "C"); in map5()
45 map.put(four, "D"); in map5()
46 map.put(five, "E"); in map5()
47 assertFalse(map.isEmpty()); in map5()
48 assertEquals(5, map.size()); in map5()
49 return map; in map5()
[all …]
DTreeMapTest.java39 TreeMap map = new TreeMap(); in map5() local
40 assertTrue(map.isEmpty()); in map5()
41 map.put(one, "A"); in map5()
42 map.put(five, "E"); in map5()
43 map.put(three, "C"); in map5()
44 map.put(two, "B"); in map5()
45 map.put(four, "D"); in map5()
46 assertFalse(map.isEmpty()); in map5()
47 assertEquals(5, map.size()); in map5()
48 return map; in map5()
[all …]
/libcore/ojluni/src/test/java/util/concurrent/tck/
DConcurrentSkipListSubMapTest.java61 ConcurrentSkipListMap map = new ConcurrentSkipListMap(); in map5() local
62 assertTrue(map.isEmpty()); in map5()
63 map.put(zero, "Z"); in map5()
64 map.put(one, "A"); in map5()
65 map.put(five, "E"); in map5()
66 map.put(three, "C"); in map5()
67 map.put(two, "B"); in map5()
68 map.put(four, "D"); in map5()
69 map.put(seven, "F"); in map5()
70 assertFalse(map.isEmpty()); in map5()
[all …]
DTreeSubMapTest.java60 TreeMap map = new TreeMap(); in map5() local
61 assertTrue(map.isEmpty()); in map5()
62 map.put(zero, "Z"); in map5()
63 map.put(one, "A"); in map5()
64 map.put(five, "E"); in map5()
65 map.put(three, "C"); in map5()
66 map.put(two, "B"); in map5()
67 map.put(four, "D"); in map5()
68 map.put(seven, "F"); in map5()
69 assertFalse(map.isEmpty()); in map5()
[all …]
DConcurrentSkipListMapTest.java63 ConcurrentSkipListMap map = new ConcurrentSkipListMap(); in map5() local
64 assertTrue(map.isEmpty()); in map5()
65 map.put(one, "A"); in map5()
66 map.put(five, "E"); in map5()
67 map.put(three, "C"); in map5()
68 map.put(two, "B"); in map5()
69 map.put(four, "D"); in map5()
70 assertFalse(map.isEmpty()); in map5()
71 assertEquals(5, map.size()); in map5()
72 return map; in map5()
[all …]
DConcurrentHashMapTest.java65 ConcurrentHashMap<Integer, String> map = new ConcurrentHashMap<>(5); in map5() local
66 assertTrue(map.isEmpty()); in map5()
67 map.put(one, "A"); in map5()
68 map.put(two, "B"); in map5()
69 map.put(three, "C"); in map5()
70 map.put(four, "D"); in map5()
71 map.put(five, "E"); in map5()
72 assertFalse(map.isEmpty()); in map5()
73 assertEquals(5, map.size()); in map5()
74 return map; in map5()
[all …]
DTreeMapTest.java62 TreeMap map = new TreeMap(); in map5() local
63 assertTrue(map.isEmpty()); in map5()
64 map.put(one, "A"); in map5()
65 map.put(five, "E"); in map5()
66 map.put(three, "C"); in map5()
67 map.put(two, "B"); in map5()
68 map.put(four, "D"); in map5()
69 assertFalse(map.isEmpty()); in map5()
70 assertEquals(5, map.size()); in map5()
71 return map; in map5()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DSortedMapTestBase.java43 SortedMap<Integer, Integer> map; field in SortedMapTestBase
56 map.clear(); in testClear()
57 assertTrue(map.isEmpty()); in testClear()
63 assertEquals(ref.containsKey(key), map.containsKey(key)); in testContainsKey()
71 assertEquals(ref.containsValue(value), map.containsValue(value)); in testContainsValue()
78 Set<Map.Entry<Integer, Integer>> mapSet = map.entrySet(); in testEntrySet()
85 assertEquals(ref.entrySet(), map.entrySet()); in testEntrySet()
92 assertEquals(ref.get(key), map.get(key)); in testGet()
98 assertEquals(ref.keySet(), map.keySet()); in testKeySet()
100 Iterator<Integer> j = map.keySet().iterator(); in testKeySet()
[all …]
DIdentityHashMapTest.java145 IdentityHashMap map = new IdentityHashMap(); in test_clone() local
146 map.put("key", "value"); in test_clone()
148 Set keys = map.keySet(); in test_clone()
149 Collection values = map.values(); in test_clone()
154 AbstractMap map2 = (AbstractMap) map.clone(); in test_clone()
262 Map map = new IdentityHashMap(101); in test_keySet() local
263 map.put(new Integer(1), "1"); in test_keySet()
264 map.put(new Integer(102), "102"); in test_keySet()
265 map.put(new Integer(203), "203"); in test_keySet()
266 Iterator it = map.keySet().iterator(); in test_keySet()
[all …]
DAbstractMapTest.java142 AbstractMap map = new HashMap(); in test_clear() local
143 map.put(1, 1); in test_clear()
144 map.clear(); in test_clear()
145 assertTrue(map.isEmpty()); in test_clear()
175 AbstractMap map = new AMT(); in test_containsKey() local
177 assertFalse(map.containsKey("k")); in test_containsKey()
178 assertFalse(map.containsKey(null)); in test_containsKey()
180 map.put("k", "v"); in test_containsKey()
181 map.put("key", null); in test_containsKey()
182 map.put(null, "value"); in test_containsKey()
[all …]
/libcore/support/src/test/java/tests/support/
DSupport_MapTest2.java25 Map<String, String> map; field in Support_MapTest2
29 map = m; in Support_MapTest2()
30 if (!map.isEmpty()) { in Support_MapTest2()
38 map.put("one", "1"); in runTest()
39 assertEquals("size should be one", 1, map.size()); in runTest()
40 map.clear(); in runTest()
41 assertEquals("size should be zero", 0, map.size()); in runTest()
42 assertTrue("Should not have entries", !map.entrySet().iterator() in runTest()
44 assertTrue("Should not have keys", !map.keySet().iterator() in runTest()
46 assertTrue("Should not have values", !map.values().iterator() in runTest()
[all …]
/libcore/benchmarks/src/benchmarks/
DHashedCollectionsBenchmark.java29 HashMap<String, String> map = new HashMap<String, String>(); in timeHashMapGet() local
30 map.put("hello", "world"); in timeHashMapGet()
32 map.get("hello"); in timeHashMapGet()
36 HashMap<String, String> map = new HashMap<String, String>(); in timeHashMapGet_Synchronized() local
37 synchronized (map) { in timeHashMapGet_Synchronized()
38 map.put("hello", "world"); in timeHashMapGet_Synchronized()
41 synchronized (map) { in timeHashMapGet_Synchronized()
42 map.get("hello"); in timeHashMapGet_Synchronized()
47 Hashtable<String, String> map = new Hashtable<String, String>(); in timeHashtableGet() local
48 map.put("hello", "world"); in timeHashtableGet()
[all …]
/libcore/ojluni/src/main/java/java/beans/
DChangeListenerMap.java48 private Map<String, L[]> map; field in ChangeListenerMap
78 if (this.map == null) { in add()
79 this.map = new HashMap<>(); in add()
81 L[] array = this.map.get(name); in add()
91 this.map.put(name, clone); in add()
103 if (this.map != null) { in remove()
104 L[] array = this.map.get(name); in remove()
113 this.map.put(name, clone); in remove()
116 this.map.remove(name); in remove()
117 if (this.map.isEmpty()) { in remove()
[all …]
/libcore/ojluni/src/main/java/java/util/
DHashSet.java95 private transient HashMap<E,Object> map; field in HashSet
105 map = new HashMap<>(); in HashSet()
118 map = new HashMap<>(Math.max((int) (c.size()/.75f) + 1, 16)); in HashSet()
132 map = new HashMap<>(initialCapacity, loadFactor); in HashSet()
144 map = new HashMap<>(initialCapacity); in HashSet()
161 map = new LinkedHashMap<>(initialCapacity, loadFactor); in HashSet()
172 return map.keySet().iterator(); in iterator()
181 return map.size(); in size()
190 return map.isEmpty(); in isEmpty()
203 return map.containsKey(o); in contains()
[all …]
/libcore/luni/src/test/java/libcore/java/util/concurrent/
DConcurrentSkipListMapTest.java105 ConcurrentSkipListMap map = new ConcurrentSkipListMap(); in createPopulatedMap() local
106 map.put("A", "a"); in createPopulatedMap()
107 map.put("B", "b"); in createPopulatedMap()
108 map.put("C", "c"); in createPopulatedMap()
109 map.put("D", "d"); in createPopulatedMap()
110 map.put("E", "e"); in createPopulatedMap()
111 map.put("F", "f"); in createPopulatedMap()
112 assertFalse(map.isEmpty()); in createPopulatedMap()
113 return map; in createPopulatedMap()
118 ConcurrentSkipListMap map = createPopulatedMap(); in testCloneFromSorted() local
[all …]
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
DMapOpTest.java53 assertCountSum(countTo(0).stream().map(mId), 0, 0); in testMap()
54 assertCountSum(countTo(10).stream().map(mId), 10, 55); in testMap()
55 assertCountSum(countTo(10).stream().map(mZero), 10, 0); in testMap()
56 assertCountSum(countTo(0).stream().map(mDoubler), 0, 0); in testMap()
57 assertCountSum(countTo(10).stream().map(mDoubler), 10, 110); in testMap()
58 assertCountSum(countTo(10).stream().map(mDoubler).map(mDoubler), 10, 220); in testMap()
60 exerciseOps(countTo(0), s -> s.map(LambdaTestHelpers.identity()), countTo(0)); in testMap()
61 exerciseOps(countTo(1000), s -> s.map(LambdaTestHelpers.identity()), countTo(1000)); in testMap()
65 exerciseOps(countTo(1000), s -> s.map(e -> (Integer) (1000 + e)), range(1001, 2000)); in testMap()
87 … exerciseOpsInt(data, s -> s.map(mId), s -> s.map(e -> e), s -> s.map(e -> e), s -> s.map(e -> e)); in testOps()
[all …]
/libcore/ojluni/src/main/java/java/time/
DZoneId.java220 Map<String, String> map = new HashMap<>(64);
221 map.put("ACT", "Australia/Darwin");
222 map.put("AET", "Australia/Sydney");
223 map.put("AGT", "America/Argentina/Buenos_Aires");
224 map.put("ART", "Africa/Cairo");
225 map.put("AST", "America/Anchorage");
226 map.put("BET", "America/Sao_Paulo");
227 map.put("BST", "Asia/Dhaka");
228 map.put("CAT", "Africa/Harare");
229 map.put("CNT", "America/St_Johns");
[all …]
/libcore/ojluni/src/main/java/sun/nio/ch/
DSocketOptionRegistry.java59 Map<RegistryKey,OptionKey> map = in options() local
61map.put(new RegistryKey(StandardSocketOptions.SO_BROADCAST, Net.UNSPEC), new OptionKey(1, 6)); in options()
62map.put(new RegistryKey(StandardSocketOptions.SO_KEEPALIVE, Net.UNSPEC), new OptionKey(1, 9)); in options()
63map.put(new RegistryKey(StandardSocketOptions.SO_LINGER, Net.UNSPEC), new OptionKey(1, 13)); in options()
64map.put(new RegistryKey(StandardSocketOptions.SO_SNDBUF, Net.UNSPEC), new OptionKey(1, 7)); in options()
65map.put(new RegistryKey(StandardSocketOptions.SO_RCVBUF, Net.UNSPEC), new OptionKey(1, 8)); in options()
66map.put(new RegistryKey(StandardSocketOptions.SO_REUSEADDR, Net.UNSPEC), new OptionKey(1, 2)); in options()
67map.put(new RegistryKey(StandardSocketOptions.TCP_NODELAY, Net.UNSPEC), new OptionKey(6, 1)); in options()
68map.put(new RegistryKey(StandardSocketOptions.IP_TOS, StandardProtocolFamily.INET), new OptionKey(… in options()
69map.put(new RegistryKey(StandardSocketOptions.IP_MULTICAST_IF, StandardProtocolFamily.INET), new O… in options()
[all …]
/libcore/ojluni/src/test/java/time/tck/java/time/format/
DTCKDateTimeTextPrinting.java161 Map<Long, String> map = new HashMap<Long, String>(); in test_appendTextMap() local
162 map.put(1L, "JNY"); in test_appendTextMap()
163 map.put(2L, "FBY"); in test_appendTextMap()
164 map.put(3L, "MCH"); in test_appendTextMap()
165 map.put(4L, "APL"); in test_appendTextMap()
166 map.put(5L, "MAY"); in test_appendTextMap()
167 map.put(6L, "JUN"); in test_appendTextMap()
168 map.put(7L, "JLY"); in test_appendTextMap()
169 map.put(8L, "AGT"); in test_appendTextMap()
170 map.put(9L, "SPT"); in test_appendTextMap()
[all …]

12345678