Searched refs:object (Results 1 - 25 of 58) sorted by relevance

123

/libcore/json/src/test/java/org/json/
H A DJSONObjectTest.java40 JSONObject object = new JSONObject();
41 assertEquals(0, object.length());
43 // bogus (but documented) behaviour: returns null rather than the empty object!
44 assertNull(object.names());
47 assertNull(object.toJSONArray(new JSONArray()));
48 assertEquals("{}", object.toString());
49 assertEquals("{}", object.toString(5));
51 object.get("foo");
56 object.getBoolean("foo");
61 object
[all...]
H A DJSONStringerTest.java41 stringer.object();
77 stringer.object();
156 new JSONStringer().object().endArray();
161 new JSONStringer().object().key("a").key("a");
166 new JSONStringer().object().value(false);
174 new JSONStringer().object().key(null);
182 stringer.object();
192 stringer.object();
222 new JSONStringer().object().key(original).value(false).endObject().toString());
224 new JSONStringer().object()
[all...]
H A DParsingTest.java164 assertParsed(object("foo", 5), "{\"foo\": 5}");
165 assertParsed(object("foo", 5), "{foo: 5}");
166 assertParsed(object("foo", 5, "bar", "baz"), "{\"foo\": 5, \"bar\": \"baz\"}");
167 assertParsed(object("foo", 5, "bar", "baz"), "{\"foo\": 5; \"bar\": \"baz\"}");
168 assertParsed(object("foo", 5, "bar", "baz"), "{\"foo\"= 5; \"bar\"= \"baz\"}");
169 assertParsed(object("foo", 5, "bar", "baz"), "{\"foo\"=> 5; \"bar\"=> \"baz\"}");
170 assertParsed(object("foo", object(), "bar", array()), "{\"foo\"=> {}; \"bar\"=> []}");
171 assertParsed(object("foo", object("fo
224 private JSONObject object(Object... keyValuePairs) throws JSONException { method in class:ParsingTest
[all...]
H A DSelfUseTest.java42 private final JSONObject object = new JSONObject() { field in class:SelfUseTest
125 object.putOpt("foo", "bar");
130 object.accumulate("foo", "bar");
135 object.put("foo", "true");
136 object.getBoolean("foo");
141 object.optBoolean("foo");
144 object.optDouble("foo");
147 object.optInt("foo");
150 object.optLong("foo");
153 object
[all...]
H A DJSONArrayTest.java54 // bogus (but documented) behaviour: returns null rather than an empty object!
333 JSONObject object = values.toJSONObject(keys);
334 assertEquals(5.5d, object.get("a"));
335 assertEquals(false, object.get("b"));
339 assertEquals(5.5d, object.get("a"));
352 JSONObject object = values.toJSONObject(keys);
353 assertEquals(1, object.length());
354 assertFalse(object.has("b"));
355 assertEquals("{\"a\":5.5}", object.toString());
364 JSONObject object
[all...]
/libcore/ojluni/src/main/java/java/security/
H A DGuard.java29 * <p> This interface represents a guard, which is an object that is used
30 * to protect access to another object.
33 * with a single <code>object</code> argument. <code>checkGuard</code> is
35 * to determine whether or not to allow access to the object.
46 * Determines whether or not to allow access to the guarded object
47 * <code>object</code>. Returns silently if access is allowed.
50 * @param object the object being protected by the guard.
55 void checkGuard(Object object) throws SecurityException; argument
H A DGuardedObject.java29 * A GuardedObject is an object that is used to protect access to
30 * another object.
32 * <p>A GuardedObject encapsulates a target object and a Guard object,
33 * such that access to the target object is possible
34 * only if the Guard object allows it.
35 * Once an object is encapsulated by a GuardedObject,
36 * access to that object is controlled by the <code>getObject</code>
38 * <code>checkGuard</code> method on the Guard object that is
53 private Object object; // th field in class:GuardedObject
66 GuardedObject(Object object, Guard guard) argument
[all...]
H A DPermission.java36 public void checkGuard(Object object) throws SecurityException { } argument
/libcore/json/src/main/java/org/json/
H A DJSONArray.java92 Object object = readFrom.nextValue();
93 if (object instanceof JSONArray) {
94 values = ((JSONArray) object).values;
96 throw JSON.typeMismatch(object, "JSONArray");
327 Object object = get(index);
328 Boolean result = JSON.toBoolean(object);
330 throw JSON.typeMismatch(index, object, "boolean");
348 Object object = opt(index);
349 Boolean result = JSON.toBoolean(object);
361 Object object
[all...]
H A DJSONObject.java71 * named entry from the object but {@code put(name, JSONObject.NULL)} stores an
144 * object in the tokener.
156 Object object = readFrom.nextValue();
157 if (object instanceof JSONObject) {
158 this.nameValuePairs = ((JSONObject) object).nameValuePairs;
160 throw JSON.typeMismatch(object, "JSONObject");
168 * @param json a JSON-encoded string containing an object.
178 * from the given object. Names that aren't present in {@code copyFrom} will
192 * Returns the number of name/value mappings in this object.
202 * @return this object
[all...]
/libcore/luni/src/main/java/libcore/icu/
H A DCollationKeyICU.java43 public boolean equals(Object object) { argument
44 if (object == this) {
47 if (!(object instanceof CollationKey)) {
50 return compareTo((CollationKey) object) == 0;
/libcore/ojluni/src/main/java/java/lang/reflect/
H A DField.java70 * Returns the {@code Class} object representing the class or interface
71 * that declares the field represented by this {@code Field} object.
78 * Returns the name of the field represented by this {@code Field} object.
95 * by this {@code Field} object, as an integer. The {@code Modifier} class should
129 * Returns a {@code Class} object that identifies the
131 * {@code Field} object.
133 * @return a {@code Class} object identifying the declared
134 * type of the field represented by this object
141 * Returns a {@code Type} object that represents the declared type for
142 * the field represented by this {@code Field} object
317 get(Object object) argument
342 getBoolean(Object object) argument
367 getByte(Object object) argument
394 getChar(Object object) argument
421 getShort(Object object) argument
448 getInt(Object object) argument
475 getLong(Object object) argument
502 getFloat(Object object) argument
529 getDouble(Object object) argument
598 set(Object object, Object value) argument
625 setBoolean(Object object, boolean value) argument
652 setByte(Object object, byte value) argument
679 setChar(Object object, char value) argument
706 setShort(Object object, short value) argument
733 setInt(Object object, int value) argument
760 setLong(Object object, long value) argument
787 setFloat(Object object, float value) argument
814 setDouble(Object object, double value) argument
[all...]
/libcore/support/src/test/java/org/apache/harmony/security/tests/support/
H A DMyGuard.java33 public void checkGuard(Object object) { argument
/libcore/luni/src/test/java/libcore/util/
H A DSerializationTester.java82 private static byte[] serialize(Object object) throws IOException { argument
84 new ObjectOutputStream(out).writeObject(object);
112 * Returns a serialized-and-deserialized copy of {@code object}.
114 public static Object reserialize(Object object) throws IOException, ClassNotFoundException { argument
115 return deserialize(serialize(object));
118 public static String serializeHex(Object object) throws IOException { argument
119 return hexEncode(serialize(object));
/libcore/luni/src/test/java/libcore/java/io/
H A DOldObjectInputStreamGetFieldTest.java71 Support_GetPutFields object = (Support_GetPutFields) ois.readObject();
75 assertTrue("Test 1: The object read from the reference file does " +
77 object.equals(newObject));
86 assertTrue("Test 2: The object read from the reference file does " +
99 Support_GetPutFields object = (Support_GetPutFields) ois.readObject();
100 ObjectInputStream.GetField fields = object.getField;
123 Support_GetPutFields object = (Support_GetPutFields) ois.readObject();
124 ObjectInputStream.GetField fields = object.getField;
239 Support_GetPutFields object = (Support_GetPutFields) ois.readObject();
241 object
[all...]
H A DObjectOutputStreamTest.java81 CallsCloseInWriteObjectMethod object = new CallsCloseInWriteObjectMethod(hello);
84 // the object closes the ObjectOutputStream and clears the handle table
87 // When it is deserialized the list contains object, hello, Arrays.asList().getClass()
88 // instead of object, hello, hello.
89 List<Serializable> input = Arrays.asList(object, hello, hello);
97 private Serializable roundTrip(Object object) argument
101 oos.writeObject(object);
/libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/
H A DGuardedObjectTest.java53 public void checkGuard(Object object) throws SecurityException {
54 if (object == objBuffer && objBuffer.length() == 0) {
/libcore/ojluni/src/main/java/java/util/function/
H A DPredicate.java109 * @param targetRef the object reference with which to compare for equality,
117 : object -> targetRef.equals(object);
/libcore/support/src/test/java/org/apache/harmony/testframework/serialization/
H A DSerializationTest.java105 * Returns golden file for an object being tested.
124 * returned by {@link #getData() getData()}to golden files, each object to
147 * Serializes specified object to an output stream.
158 * Deserializes single object from an input stream.
179 * @param initial - initial object used for creating serialized form
180 * @param deserialized - deserialized object
193 * Comparator for verifying that deserialized object is the same as initial.
253 * <code>object</code>.
257 * selected as </code>comparator</code>.<br>- if passed <code>object</code>
260 * method tries to select one of known comparators basing on <code>object'
269 defineComparator(TestCase test, Object object) argument
303 verifyGolden(TestCase test, Object object) argument
319 verifyGolden(TestCase test, Object object, SerializableAssert comparator) argument
373 verifySelf(Object object) argument
386 verifySelf(Object object, SerializableAssert comparator) argument
447 createGoldenFile(String root, TestCase test, Object object) argument
[all...]
/libcore/benchmarks/src/benchmarks/
H A DReferenceBenchmark.java30 private Object object; field in class:ReferenceBenchmark
36 new PhantomReference(object, queue);
44 (new PhantomReference<Object>(object, queue)).enqueue();
52 (new PhantomReference<Object>(object, queue)).enqueue();
63 (new PhantomReference<Object>(object, queue)).enqueue();
/libcore/benchmarks/src/benchmarks/regression/
H A DSerializationBenchmark.java46 ArrayList<Integer> object = new ArrayList<Integer>();
48 object.add(i);
50 readSingleObject(reps, object);
54 ArrayList<Integer> object = new ArrayList<Integer>();
56 object.add(i);
58 writeSingleObject(reps, object);
95 private void readSingleObject(int reps, Object object) throws Exception { argument
96 byte[] bytes = bytes(object);
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/
H A DSupport_Format.java37 protected void t_FormatWithField(int count, Format format, Object object, argument
41 format.format(object, buffer, pos);
58 protected void t_Format(int count, Object object, Format format, Vector<FieldContainer> expectedResults) { argument
59 Vector<FieldContainer> results = findFields(format.formatToCharacterIterator(object));
61 format.format(object) + "\n" +
/libcore/support/src/test/java/tests/support/
H A DSupport_Format.java36 protected void t_FormatWithField(int count, Format format, Object object, argument
40 format.format(object, buffer, pos);
59 protected void t_Format(int count, Object object, Format format, argument
61 // System.out.println(format.format(object));
62 Vector<FieldContainer> results = findFields(format.formatToCharacterIterator(object));
65 + format.format(object), compare(results, expectedResults));
/libcore/luni/src/main/java/java/util/concurrent/
H A DCopyOnWriteArrayList.java143 * Searches this list for {@code object} and returns the index of the first
146 * @return the index or -1 if the object was not found.
148 public int indexOf(E object, int from) { argument
150 return indexOf(object, snapshot, from, snapshot.length);
153 public int indexOf(Object object) { argument
155 return indexOf(object, snapshot, 0, snapshot.length);
159 * Searches this list for {@code object} and returns the index of the last
162 * @return the index or -1 if the object was not found.
164 public int lastIndexOf(E object, int to) { argument
166 return lastIndexOf(object, snapsho
169 lastIndexOf(Object object) argument
334 addIfAbsent(E object) argument
572 indexOf(Object object) argument
580 lastIndexOf(Object object) argument
588 contains(Object object) argument
626 add(int index, E object) argument
635 add(E object) argument
659 set(int index, E object) argument
669 remove(Object object) argument
775 add(E object) argument
817 set(E object) argument
[all...]
/libcore/ojluni/src/main/native/
H A Dio_util.h67 * string is a JNI reference to a java.lang.String object, and
72 * a given field of a given object:
74 * WITH_FIELD_PLATFORM_STRING(env, object, id, var) {
79 * object is a jobject,
98 #define WITH_FIELD_PLATFORM_STRING(env, object, id, var) \
100 ((object == NULL) \
102 : (*(env))->GetObjectField((env), (object), (id))), \

Completed in 1107 milliseconds

123