Lines Matching defs:ai
35 AtomicInteger ai = new AtomicInteger(1);
36 assertEquals(1, ai.get());
43 AtomicInteger ai = new AtomicInteger();
44 assertEquals(0, ai.get());
51 AtomicInteger ai = new AtomicInteger(1);
52 assertEquals(1, ai.get());
53 ai.set(2);
54 assertEquals(2, ai.get());
55 ai.set(-3);
56 assertEquals(-3, ai.get());
63 AtomicInteger ai = new AtomicInteger(1);
64 assertEquals(1, ai.get());
65 ai.lazySet(2);
66 assertEquals(2, ai.get());
67 ai.lazySet(-3);
68 assertEquals(-3, ai.get());
75 AtomicInteger ai = new AtomicInteger(1);
76 assertTrue(ai.compareAndSet(1, 2));
77 assertTrue(ai.compareAndSet(2, -4));
78 assertEquals(-4, ai.get());
79 assertFalse(ai.compareAndSet(-5, 7));
80 assertEquals(-4, ai.get());
81 assertTrue(ai.compareAndSet(-4, 7));
82 assertEquals(7, ai.get());
90 final AtomicInteger ai = new AtomicInteger(1);
93 while (!ai.compareAndSet(2, 3))
98 assertTrue(ai.compareAndSet(1, 2));
101 assertEquals(3, ai.get());
109 AtomicInteger ai = new AtomicInteger(1);
110 do {} while (!ai.weakCompareAndSet(1, 2));
111 do {} while (!ai.weakCompareAndSet(2, -4));
112 assertEquals(-4, ai.get());
113 do {} while (!ai.weakCompareAndSet(-4, 7));
114 assertEquals(7, ai.get());
121 AtomicInteger ai = new AtomicInteger(1);
122 assertEquals(1, ai.getAndSet(0));
123 assertEquals(0, ai.getAndSet(-10));
124 assertEquals(-10, ai.getAndSet(1));
131 AtomicInteger ai = new AtomicInteger(1);
132 assertEquals(1, ai.getAndAdd(2));
133 assertEquals(3, ai.get());
134 assertEquals(3, ai.getAndAdd(-4));
135 assertEquals(-1, ai.get());
142 AtomicInteger ai = new AtomicInteger(1);
143 assertEquals(1, ai.getAndDecrement());
144 assertEquals(0, ai.getAndDecrement());
145 assertEquals(-1, ai.getAndDecrement());
152 AtomicInteger ai = new AtomicInteger(1);
153 assertEquals(1, ai.getAndIncrement());
154 assertEquals(2, ai.get());
155 ai.set(-2);
156 assertEquals(-2, ai.getAndIncrement());
157 assertEquals(-1, ai.getAndIncrement());
158 assertEquals(0, ai.getAndIncrement());
159 assertEquals(1, ai.get());
166 AtomicInteger ai = new AtomicInteger(1);
167 assertEquals(3, ai.addAndGet(2));
168 assertEquals(3, ai.get());
169 assertEquals(-1, ai.addAndGet(-4));
170 assertEquals(-1, ai.get());
177 AtomicInteger ai = new AtomicInteger(1);
178 assertEquals(0, ai.decrementAndGet());
179 assertEquals(-1, ai.decrementAndGet());
180 assertEquals(-2, ai.decrementAndGet());
181 assertEquals(-2, ai.get());
188 AtomicInteger ai = new AtomicInteger(1);
189 assertEquals(2, ai.incrementAndGet());
190 assertEquals(2, ai.get());
191 ai.set(-2);
192 assertEquals(-1, ai.incrementAndGet());
193 assertEquals(0, ai.incrementAndGet());
194 assertEquals(1, ai.incrementAndGet());
195 assertEquals(1, ai.get());
216 AtomicInteger ai = new AtomicInteger();
217 assertEquals("0", ai.toString());
219 ai.set(x);
220 assertEquals(Integer.toString(x), ai.toString());
228 AtomicInteger ai = new AtomicInteger();
229 assertEquals(0, ai.intValue());
231 ai.set(x);
232 assertEquals(x, ai.intValue());
240 AtomicInteger ai = new AtomicInteger();
241 assertEquals(0L, ai.longValue());
243 ai.set(x);
244 assertEquals((long)x, ai.longValue());
252 AtomicInteger ai = new AtomicInteger();
253 assertEquals(0.0f, ai.floatValue());
255 ai.set(x);
256 assertEquals((float)x, ai.floatValue());
264 AtomicInteger ai = new AtomicInteger();
265 assertEquals(0.0d, ai.doubleValue());
267 ai.set(x);
268 assertEquals((double)x, ai.doubleValue());