Searched refs:empty (Results 1 - 25 of 70) sorted by relevance

123

/libcore/luni/src/test/java/libcore/java/util/
H A DOptionalIntTest.java31 assertSame(OptionalInt.empty(), OptionalInt.empty());
38 OptionalInt.empty().getAsInt();
46 assertFalse(OptionalInt.empty().isPresent());
51 OptionalInt.empty().ifPresent(alwaysFails);
60 assertEquals(57, OptionalInt.empty().orElse(57));
69 assertEquals(57, OptionalInt.empty().orElseGet(supplies57));
79 OptionalInt.empty().orElseThrow(barSupplier);
87 assertEquals(OptionalInt.empty(), OptionalInt.empty());
[all...]
H A DOptionalLongTest.java31 assertSame(OptionalLong.empty(), OptionalLong.empty());
38 OptionalLong.empty().getAsLong();
46 assertFalse(OptionalLong.empty().isPresent());
51 OptionalLong.empty().ifPresent(alwaysFails);
60 assertEquals(57, OptionalLong.empty().orElse(57));
69 assertEquals(57, OptionalLong.empty().orElseGet(supplies57));
79 OptionalLong.empty().orElseThrow(barSupplier);
87 assertEquals(OptionalLong.empty(), OptionalLong.empty());
[all...]
H A DOptionalTest.java33 // empty() is a singleton instance.
34 assertSame(Optional.<Integer>empty(), Optional.<String>empty());
35 assertSame(Optional.<String>empty(), Optional.<String>empty());
37 // Note that we assert here that the empty() optional is the same instance
40 assertSame(Optional.<String>empty(), Optional.ofNullable(null));
44 Optional<String> empty = Optional.empty();
47 empty
[all...]
H A DOptionalDoubleTest.java33 assertSame(OptionalDouble.empty(), OptionalDouble.empty());
40 OptionalDouble.empty().getAsDouble();
48 assertFalse(OptionalDouble.empty().isPresent());
53 OptionalDouble.empty().ifPresent(alwaysFails);
62 assertEquals(57.0, OptionalDouble.empty().orElse(57.0));
71 assertEquals(57.0, OptionalDouble.empty().orElseGet(supplies57));
81 OptionalDouble.empty().orElseThrow(barSupplier);
89 assertEquals(OptionalDouble.empty(), OptionalDouble.empty());
[all...]
H A DSpliteratorsTest.java37 Spliterator.OfInt empty = Spliterators.emptyIntSpliterator();
38 assertNull(empty.trySplit());
39 assertEquals(0, empty.estimateSize());
40 assertEquals(0, empty.getExactSizeIfKnown());
44 empty.tryAdvance(alwaysFails);
45 empty.tryAdvance(alwaysFailsBoxed);
47 empty.forEachRemaining(alwaysFails);
48 empty.forEachRemaining(alwaysFailsBoxed);
50 assertEquals(Spliterator.SIZED | Spliterator.SUBSIZED, empty.characteristics());
54 Spliterator<Object> empty
[all...]
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
H A DMinMaxTest.java68 assertEquals(IntStream.empty().min(), OptionalInt.empty());
69 assertEquals(IntStream.empty().max(), OptionalInt.empty());
81 assertEquals(LongStream.empty().min(), OptionalLong.empty());
82 assertEquals(LongStream.empty().max(), OptionalLong.empty());
94 assertEquals(DoubleStream.empty().min(), OptionalDouble.empty());
[all...]
H A DConcatTest.java56 List<Integer> empty = new LinkedList<>(); // To be ordered
57 assertTrue(empty.isEmpty());
73 { "empty something", empty, part1, part1 },
74 { "something empty", part1, empty, part1 },
75 { "empty empty", empty, empty, empt
[all...]
H A DExplodeOpTest.java79 result = exerciseOps(data, s-> s.flatMap(e -> Stream.empty()));
95 result = exerciseOps(data, s -> s.flatMap(i -> IntStream.empty()));
110 result = exerciseOps(data, s -> LongStream.empty());
125 result = exerciseOps(data, s -> DoubleStream.empty());
/libcore/luni/src/test/java/libcore/javax/net/ssl/
H A DKeyManagerFactoryTest.java129 private void test_KeyManagerFactory_getKeyManagers(KeyManagerFactory kmf, boolean empty) argument
137 test_X509KeyManager((X509KeyManager) keyManager, empty, kmf.getAlgorithm());
160 private void test_X509KeyManager(X509KeyManager km, boolean empty, String algorithm) argument
165 if (empty || keyType == null || keyType.isEmpty()) {
171 test_X509KeyManager_alias(km, alias, keyType, false, empty);
176 if (empty || keyType == null || keyType.isEmpty()) {
182 test_X509KeyManager_alias(km, alias, keyType, false, empty);
187 test_X509KeyManager_alias(km, a, null, true, empty);
192 test_X509KeyManager_alias(km, alias, keyType, false, empty);
196 test_X509KeyManager_alias(km, alias, keyType, false, empty);
203 test_X509ExtendedKeyManager(X509ExtendedKeyManager km, boolean empty, String algorithm) argument
219 test_X509KeyManager_alias(X509KeyManager km, String alias, String keyType, boolean many, boolean empty) argument
[all...]
/libcore/luni/src/main/native/
H A Dcanonicalize_path.cpp63 while (!left.empty()) {
72 if (nextPathComponent.empty()) {
111 if (!left.empty()) {
/libcore/ojluni/src/main/java/java/util/
H A DOptional.java47 * Common instance for {@code empty()}.
57 * Constructs an empty instance.
59 * @implNote Generally only one empty instance, {@link Optional#EMPTY},
67 * Returns an empty {@code Optional} instance. No value is present for this
71 * is empty by comparing with {@code ==} against instances returned by
72 * {@code Option.empty()}. There is no guarantee that it is a singleton.
76 * @return an empty {@code Optional}
78 public static<T> Optional<T> empty() { method in class:Optional
108 * otherwise returns an empty {@code Optional}.
113 * is non-null, otherwise an empty {
[all...]
H A DStack.java34 * for whether the stack is <tt>empty</tt>, and a method to <tt>search</tt>
51 * Creates an empty Stack.
78 * @throws EmptyStackException if this stack is empty.
96 * @throws EmptyStackException if this stack is empty.
107 * Tests if this stack is empty.
112 public boolean empty() { method in class:Stack
H A DOptionalDouble.java46 * Common instance for {@code empty()}.
57 * Construct an empty instance.
59 * @implNote generally only one empty instance, {@link OptionalDouble#EMPTY},
68 * Returns an empty {@code OptionalDouble} instance. No value is present for this
72 * is empty by comparing with {@code ==} against instances returned by
73 * {@code Option.empty()}. There is no guarantee that it is a singleton.
76 * @return an empty {@code OptionalDouble}.
78 public static OptionalDouble empty() { method in class:OptionalDouble
168 * @apiNote A method reference to the exception constructor with an empty
231 * Returns a non-empty strin
[all...]
H A DOptionalInt.java46 * Common instance for {@code empty()}.
57 * Construct an empty instance.
59 * @implNote Generally only one empty instance, {@link OptionalInt#EMPTY},
68 * Returns an empty {@code OptionalInt} instance. No value is present for this
72 * is empty by comparing with {@code ==} against instances returned by
73 * {@code Option.empty()}. There is no guarantee that it is a singleton.
76 * @return an empty {@code OptionalInt}
78 public static OptionalInt empty() { method in class:OptionalInt
169 * @apiNote A method reference to the exception constructor with an empty
232 * Returns a non-empty strin
[all...]
H A DOptionalLong.java46 * Common instance for {@code empty()}.
57 * Construct an empty instance.
59 * @implNote generally only one empty instance, {@link OptionalLong#EMPTY},
68 * Returns an empty {@code OptionalLong} instance. No value is present for this
72 * is empty by comparing with {@code ==} against instances returned by
73 * {@code Option.empty()}. There is no guarantee that it is a singleton.
76 * @return an empty {@code OptionalLong}.
78 public static OptionalLong empty() { method in class:OptionalLong
168 * @apiNote A method reference to the exception constructor with an empty
231 * Returns a non-empty strin
[all...]
/libcore/ojluni/src/main/java/java/util/stream/
H A DReduceOps.java109 private boolean empty;
113 empty = true;
119 if (empty) {
120 empty = false;
129 return empty ? Optional.empty() : Optional.of(state);
134 if (!other.empty)
291 private boolean empty;
295 empty = true;
301 if (empty) {
[all...]
H A DFindOps.java58 return new FindOp<>(mustFindFirst, StreamShape.REFERENCE, Optional.empty(),
70 return new FindOp<>(mustFindFirst, StreamShape.INT_VALUE, OptionalInt.empty(),
82 return new FindOp<>(mustFindFirst, StreamShape.LONG_VALUE, OptionalLong.empty(),
94 return new FindOp<>(mustFindFirst, StreamShape.DOUBLE_VALUE, OptionalDouble.empty(),
/libcore/include/
H A DLocalArray.h59 bool empty() { return mSize == 0; } function in class:LocalArray
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/org/xml/sax/helpers/
H A DAttributeListImplTest.java27 private AttributeListImpl empty = new AttributeListImpl(); field in class:AttributeListImplTest
39 assertEquals(0, empty.getLength());
45 AttributeListImpl ai = new AttributeListImpl(empty);
67 attrs.setAttributeList(empty);
134 AttributeListImpl ai = new AttributeListImpl(empty);
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
H A DStackTest.java36 * java.util.Stack#empty()
39 // Test for method boolean java.util.Stack.empty()
40 assertTrue("New stack answers non-empty", s.empty());
42 assertTrue("Stack should not be empty but answers empty", !s.empty());
44 assertTrue("Stack should be empty but answers non-empty", s.empty());
[all...]
/libcore/jsr166-tests/src/test/java/jsr166/
H A DConcurrentHashMapTest.java295 ConcurrentHashMap empty = new ConcurrentHashMap();
297 assertNull(empty.get("anything"));
301 * isEmpty is true of empty map and false for non-empty
304 ConcurrentHashMap empty = new ConcurrentHashMap();
306 assertTrue(empty.isEmpty());
418 ConcurrentHashMap empty = new ConcurrentHashMap();
420 empty.putAll(map);
421 assertEquals(5, empty.size());
422 assertTrue(empty
[all...]
H A DTreeSubMapTest.java126 NavigableMap empty = map0();
127 assertNull(empty.get(one));
131 * isEmpty is true of empty map and false for non-empty
134 NavigableMap empty = map0();
136 assertTrue(empty.isEmpty());
223 NavigableMap empty = map0();
225 empty.putAll(map);
226 assertEquals(5, empty.size());
227 assertTrue(empty
[all...]
H A DCopyOnWriteArraySetTest.java55 * Default-constructed set is empty
210 * isEmpty is true when empty, else false
222 Collection empty = new CopyOnWriteArraySet();
223 assertFalse(empty.iterator().hasNext());
225 empty.iterator().next();
244 * iterator of empty collection has no elements
301 Collection empty = new CopyOnWriteArraySet();
304 assertEquals(0, empty.size());
331 Collection empty = new CopyOnWriteArraySet();
335 assertSame(a, empty
[all...]
H A DConcurrentSkipListSubMapTest.java127 ConcurrentNavigableMap empty = map0();
128 assertNull(empty.get(one));
132 * isEmpty is true of empty map and false for non-empty
135 ConcurrentNavigableMap empty = map0();
137 assertTrue(empty.isEmpty());
266 ConcurrentNavigableMap empty = map0();
268 empty.putAll(map);
269 assertEquals(5, empty.size());
270 assertTrue(empty
[all...]
/libcore/json/src/main/java/org/json/
H A DJSONStringer.java174 JSONStringer open(Scope empty, String openBracket) throws JSONException { argument
179 stack.add(empty);
188 JSONStringer close(Scope empty, Scope nonempty, String closeBracket) throws JSONException { argument
190 if (context != nonempty && context != empty) {

Completed in 795 milliseconds

123