< prev index next >

src/java.base/share/classes/java/lang/invoke/VarHandle.java

Print this page




1809          * Returns the {@code VarHandle} signature-polymorphic method name
1810          * associated with this {@code AccessMode} value.
1811          *
1812          * @return the signature-polymorphic method name
1813          * @see #valueFromMethodName
1814          */
1815         public String methodName() {
1816             return methodName;
1817         }
1818 
1819         /**
1820          * Returns the {@code AccessMode} value associated with the specified
1821          * {@code VarHandle} signature-polymorphic method name.
1822          *
1823          * @param methodName the signature-polymorphic method name
1824          * @return the {@code AccessMode} value
1825          * @throws IllegalArgumentException if there is no {@code AccessMode}
1826          *         value associated with method name (indicating the method
1827          *         name does not correspond to a {@code VarHandle}
1828          *         signature-polymorphic method name).
1829          * @see #methodName
1830          */
1831         public static AccessMode valueFromMethodName(String methodName) {
1832             AccessMode am = methodNameToAccessMode.get(methodName);
1833             if (am != null) return am;
1834             throw new IllegalArgumentException("No AccessMode value for method name " + methodName);
1835         }
1836 
1837         @ForceInline
1838         static MemberName getMemberName(int ordinal, VarForm vform) {
1839             return vform.memberName_table[ordinal];
1840         }
1841     }
1842 
1843     static final class AccessDescriptor {
1844         final MethodType symbolicMethodTypeErased;
1845         final MethodType symbolicMethodTypeInvoker;
1846         final Class<?> returnType;
1847         final int type;
1848         final int mode;
1849 




1809          * Returns the {@code VarHandle} signature-polymorphic method name
1810          * associated with this {@code AccessMode} value.
1811          *
1812          * @return the signature-polymorphic method name
1813          * @see #valueFromMethodName
1814          */
1815         public String methodName() {
1816             return methodName;
1817         }
1818 
1819         /**
1820          * Returns the {@code AccessMode} value associated with the specified
1821          * {@code VarHandle} signature-polymorphic method name.
1822          *
1823          * @param methodName the signature-polymorphic method name
1824          * @return the {@code AccessMode} value
1825          * @throws IllegalArgumentException if there is no {@code AccessMode}
1826          *         value associated with method name (indicating the method
1827          *         name does not correspond to a {@code VarHandle}
1828          *         signature-polymorphic method name).
1829          * @see #methodName()
1830          */
1831         public static AccessMode valueFromMethodName(String methodName) {
1832             AccessMode am = methodNameToAccessMode.get(methodName);
1833             if (am != null) return am;
1834             throw new IllegalArgumentException("No AccessMode value for method name " + methodName);
1835         }
1836 
1837         @ForceInline
1838         static MemberName getMemberName(int ordinal, VarForm vform) {
1839             return vform.memberName_table[ordinal];
1840         }
1841     }
1842 
1843     static final class AccessDescriptor {
1844         final MethodType symbolicMethodTypeErased;
1845         final MethodType symbolicMethodTypeInvoker;
1846         final Class<?> returnType;
1847         final int type;
1848         final int mode;
1849 


< prev index next >