Searched refs:optInt (Results 1 – 5 of 5) sorted by relevance
/libcore/json/src/test/java/libcore/org/json/ |
D | SelfUseTest.java | 68 @Override public int optInt(String key, int defaultValue) { 70 return super.optInt(key, defaultValue); 111 @Override public int optInt(int index, int fallback) { 113 return super.optInt(index, fallback); 152 object.optInt("foo"); in testObjectOptType() 199 array.optInt(3); in testArrayOptType()
|
D | JSONObjectTest.java | 103 assertEquals(0, object.optInt("foo")); in testEmptyObject() 104 assertEquals(5, object.optInt("foo", 5)); in testEmptyObject() 304 assertEquals(0, object.optInt("quux")); in testNumbers() 308 assertEquals(0, object.optInt("quux")); in testNumbers() 312 assertEquals(0, object.optInt("quux", -1)); in testNumbers() 431 assertEquals(0, object.optInt("foo")); in testStrings() 432 assertEquals(-2, object.optInt("foo", -2)); in testStrings() 437 assertEquals(5, object.optInt("bar", 3)); in testStrings() 777 assertEquals(0, copy.optInt("b")); in testCopyConstructorMissingName() 854 assertEquals(0, object.optInt(null)); in testOptNull() [all …]
|
D | JSONArrayTest.java | 234 assertEquals(0, array.optInt(0, 1)); in testNumbers() 279 assertEquals(0, array.optInt(0)); in testStrings() 280 assertEquals(-2, array.optInt(0, -2)); in testStrings() 285 assertEquals(5, array.optInt(1, 3)); in testStrings()
|
/libcore/json/src/main/java/org/json/ |
D | JSONArray.java | 409 public int optInt(int index) { in optInt() method in JSONArray 410 return optInt(index, 0); in optInt() 417 public int optInt(int index, int fallback) { in optInt() method in JSONArray
|
D | JSONObject.java | 501 public int optInt(@Nullable String name) { in optInt() method in JSONObject 502 return optInt(name, 0); in optInt() 509 public int optInt(@Nullable String name, int fallback) { in optInt() method in JSONObject
|