Searched refs:cast (Results 1 - 12 of 12) sorted by relevance

/libcore/luni/src/main/native/
H A Dlibcore_io_Memory.cpp65 template <typename T> static T cast(jlong address) { function
158 return *cast<const jbyte*>(srcAddress);
162 env->SetByteArrayRegion(dst, dstOffset, byteCount, cast<const jbyte*>(srcAddress));
178 const SWAP_TYPE* src = cast<const SWAP_TYPE*>(srcAddress); \
181 const SCALAR_TYPE* src = cast<const SCALAR_TYPE*>(srcAddress); \
211 *cast<jbyte*>(dstAddress) = value;
215 env->GetByteArrayRegion(src, offset, length, cast<jbyte*>(dstAddress));
232 SWAP_FN(cast<SWAP_TYPE*>(dstAddress), src, count); \
234 env->Get ## JNI_NAME ## ArrayRegion(src, srcOffset, count, cast<SCALAR_TYPE*>(dstAddress)); \
263 jshort result = *cast<cons
[all...]
/libcore/luni/src/main/java/java/util/concurrent/
H A DLinkedTransferQueue.java561 static <E> E cast(Object item) { method in class:LinkedTransferQueue
602 return LinkedTransferQueue.<E>cast(item);
680 return LinkedTransferQueue.<E>cast(item);
760 return LinkedTransferQueue.<E>cast(item);
838 nextItem = LinkedTransferQueue.<E>cast(item);
/libcore/luni/src/main/java/java/util/
H A DServiceLoader.java214 return service.cast(classLoader.loadClass(className).newInstance());
H A DMiniEnumSet.java109 elementClass.cast(element); // Called to throw ClassCastException.
H A DHugeEnumSet.java122 elementClass.cast(element); // Called to throw ClassCastException.
H A DEnumMap.java778 keyType.cast(key); // Called to throw ClassCastException.
/libcore/luni/src/test/java/libcore/java/lang/reflect/
H A DGenericExceptionsTest.java96 return expectedType.cast(array[0]);
/libcore/luni/src/test/java/libcore/java/lang/
H A DClassCastExceptionTest.java32 assertEquals("java.lang.Exception cannot be cast to java.lang.String", ex.getMessage());
39 String.class.cast(o);
42 assertEquals("java.lang.Exception cannot be cast to java.lang.String", ex.getMessage());
51 assertEquals("java.lang.Exception cannot be cast to java.lang.String",
61 assertEquals("java.lang.Integer cannot be cast to java.io.InputStream",
71 assertEquals("java.lang.String[] cannot be cast to "
80 assertEquals("float[] cannot be cast to libcore.java.lang.ClassCastExceptionTest$E",
88 assertEquals("char[][] cannot be cast to libcore.java.lang.ClassCastExceptionTest$E",
96 assertEquals("java.lang.Integer cannot be cast to java.lang.Object[][][]",
H A DOldClassTest.java959 Object o = PublicTestClass.class.cast(new ExtendTestClass());
963 ExtendTestClass.class.cast(new PublicTestClass());
970 ExtendTestClass.class.cast(new String());
/libcore/luni/src/main/java/javax/security/auth/
H A DSubject.java673 s.add(c.cast(o));
/libcore/libdvm/src/main/java/java/lang/
H A DClass.java700 @SuppressWarnings("unchecked") // we only cast after confirming that this class is an enum
1146 * Tests whether the given object can be cast to the class
1150 * @return {@code true} if {@code object} can be cast to the type
1152 * object} is {@code null} or cannot be cast.
1250 * if this {@code Class} cannot be cast to the given type.
1259 throw new ClassCastException(actualClassName + " cannot be cast to " + desiredClassName);
1267 * if the object cannot be cast to the given type.
1270 public T cast(Object obj) { method in class:Class
1278 throw new ClassCastException(actualClassName + " cannot be cast to " + desiredClassName);
/libcore/libart/src/main/java/java/lang/
H A DClass.java1017 @SuppressWarnings("unchecked") // we only cast after confirming that this class is an enum
1459 * Tests whether the given object can be cast to the class
1463 * @return {@code true} if {@code object} can be cast to the type
1465 * object} is {@code null} or cannot be cast.
1657 * if this {@code Class} cannot be cast to the given type.
1666 throw new ClassCastException(actualClassName + " cannot be cast to " + desiredClassName);
1674 * if the object cannot be cast to the given type.
1677 public T cast(Object obj) { method in class:Class
1685 throw new ClassCastException(actualClassName + " cannot be cast to " + desiredClassName);

Completed in 396 milliseconds