ImageVerifierCode 换一换
格式:DOCX , 页数:27 ,大小:20.84KB ,
资源ID:6605004      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-6605004.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(开源零听小清新范儿十足的音乐播放器代码案例.docx)为本站会员(b****3)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

开源零听小清新范儿十足的音乐播放器代码案例.docx

1、开源零听小清新范儿十足的音乐播放器代码案例angularbase64.jsmodule支持中文,AngularJS学习-服务Service AngularJS学习-服务Serviceangular实现的form自动布局,算法的简单实现arduino距离传感器,arduino小车前进左右转代码,array_change_key_case:返回字符串键名全,array_chunk:将一个数组分解成包含多个一代码 Java代码 package test;import canghailan.lang.Methods;/* * author canghailan 2012-03-12 21:53 */p

2、ublic class MethodLookupTest public static void main(String args) throws Exception System.out.println(Methods.publicLookup().findMethod( MethodLookupTest.class, x, Object.class) ); / public static void test.MethodLookupTest.x(java.lang.Object) System.out.println(Methods.publicLookup().findMethod( Me

3、thodLookupTest.class, x, int.class) ); / public static void test.MethodLookupTest.x(int) System.out.println(Methods.publicLookup().findMethod( MethodLookupTest.class, x, Integer.class) ); / public static void test.MethodLookupTest.x(java.lang.Integer) System.out.println(Methods.publicLookup().findMe

4、thod( MethodLookupTest.class, x, byte.class) ); / public static void test.MethodLookupTest.x(int) System.out.println(Methods.publicLookup().findMethod( MethodLookupTest.class, x, Byte.class) ); / public static void test.MethodLookupTest.x(java.lang.Object) System.out.println(Methods.publicLookup().f

5、indMethod( MethodLookupTest.class, x, String.class) ); / public static void test.MethodLookupTest.x(java.lang.Object) /C语言实现有序集合intset结构/C语言制作动态链接库.so文件 public static void x(Object o) public static void x(int o) public static void x(Integer o)文件 Methods.java2KB(10) 9 10package canghailan.lang;import

6、 java.lang.reflect.InvocationTargetException;import java.lang.reflect.Method;/* * author canghailan 2012-01-13 23:06 */public class Methods private static final MethodLookup publicLookup = new MethodLookup(1024); public static MethodLookup publicLookup() return publicLookup; public static Object inv

7、oke(Object object, String name, Object. params) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException Method method = publicLookup.findMethod( object.getClass(), name, MethodLookup.getParameterTypes(params) ); if (method != null) return method.invoke(object, params); throw

8、new NoSuchMethodException(invokeToString(object.getClass(), name, params); public static Object invokeStatic(Class clazz, String name, Object. params) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException Method method = publicLookup.findMethod( clazz, name, MethodLookup.ge

9、tParameterTypes(params) ); if (method != null) return method.invoke(null, params); throw new NoSuchMethodException(invokeToString(clazz, name, params); private static String invokeToString(Class clazz, String method, Object. params) StringBuilder buffer = new StringBuilder(); buffer.append(clazz.get

10、Name().append($); buffer.append(method).append(); for (Object param : params) buffer.append(param).append(, ); buffer.setLength(buffer.length() - , .length(); buffer.append(); return buffer.toString(); 文件 Fields.java4KB(10) 9 10package canghailan.lang;import java.lang.reflect.Field;import java.lang.

11、reflect.InvocationTargetException;import java.lang.reflect.Method;import java.lang.reflect.Modifier;/* * author canghailan 2012-01-13 23:06 */public class Fields private static final FieldLookup lookup = new FieldLookup(1024); public static FieldLookup lookup() return lookup; public static Object ge

12、t(Object object, String field) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException Method getter = lookup.findGetter(object.getClass(), field); if (getter != null) return getter.invoke(object); throw new NoSuchMethodException(Could not find getter for + object.getClass().

13、getName() + . + field); public static void set(Object object, String field, Object value) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException StringBuilder buffer = new StringBuilder(set.length() + field.length(); buffer.append(set).append(field) .setCharAt(set.length(),

14、Character.toUpperCase(field.charAt(0); Methods.invoke(object, buffer.toString(), value); public static Object directGet(Object object, String name) throws NoSuchFieldException, IllegalAccessException Field field = lookup.findField(object.getClass(), name); if (field != null) return directGet(object,

15、 field); throw new NoSuchFieldException(object.getClass().getName() + . + name); public static Object directGet(Object object, Field field) throws IllegalAccessException if (field.isAccessible() return field.get(object); else field.setAccessible(true); Object value = field.get(object); field.setAcce

16、ssible(false); return value; public static void directSet(Object object, String name, Object value) throws NoSuchFieldException, IllegalAccessException Field field = lookup.findField(object.getClass(), name); if (field != null) directSet(object, field, value); throw new NoSuchFieldException(object.g

17、etClass().getName() + . + name); public static void directSet(Object object, Field field, Object value) throws IllegalAccessException if (field.isAccessible() field.set(object, value); else field.setAccessible(true); field.set(object, value); field.setAccessible(false); public static void copy(Objec

18、t src, Object dst, String. fieldNames) throws NoSuchFieldException, IllegalAccessException, InvocationTargetException, NoSuchMethodException if (src.getClass().equals(dst.getClass() for (String fieldName : fieldNames) Field field = lookup.findField(src.getClass(), fieldName); if (field = null) throw

19、 new NoSuchFieldException(src.getClass().getName() + . + fieldName); directSet(dst, field, directGet(src, field); else for (String name : fieldNames) set(dst, name, get(src, name); public static void copy(T src, T dst) throws IllegalAccessException for (Class clz = src.getClass(); clz != null; clz =

20、 clz.getSuperclass() for (Field field : clz.getDeclaredFields() / skip static and final field if (Modifier.isStatic(field.getModifiers() | Modifier.isFinal(field.getModifiers() continue; directSet(dst, field, directGet(src, field); 文件 MethodLookup.java12KB(10) 9 10package canghailan.lang;import java

21、.lang.reflect.Method;import java.util.*;/* * author canghailan 2012-02-23 20:31 */public class MethodLookup extends CachedLookup implements MemberLookup public static final Class EMPTY_CLASSES = new Class0; public MethodLookup(Map cache) super(cache); public MethodLookup(final int cacheSize) super(c

22、acheSize); Override protected MethodsInfo doFind(Identifier key) return new MethodsInfo(key.getClazz(), key.getName(); public Method findMethod(Class clazz, String name, Class. actual) MethodInfo accept = null; for (MethodInfo methodInfo : find(new Identifier(clazz, name).getMethods(actual.length) i

23、nt diff = methodInfo.accept(actual); if (diff = 0) return methodInfo.getMethod(); if (diff 0) if (accept = null | methodInfo.isMorePrecise(accept) accept = methodInfo; return accept = null ? null : accept.getMethod(); /* * * null = null * object = object.getClass() * */ public static Class getParame

24、terTypes(Object. params) if (params = null) return null; if (params.length = 0) return EMPTY_CLASSES; Class types = new Classparams.length; for (int i = 0; i params.length; +i) typesi = paramsi = null ? null : paramsi.getClass(); return types; static class MethodsInfo static final MethodInfo EMPTY_M

25、ETHODS = new MethodInfo0; final MethodInfo methods; MethodsInfo(Class clazz, String name) methods = generateMethodsInfo(clazz, name); MethodInfo generateMethodsInfo(Class clazz, String name) int maxParameterLength = 0; MapInteger, List methodsInfoMap = new HashMap(); for (Method method : clazz.getMe

26、thods() if (method.getName().equals(name) int parameterLength = method.getParameterTypes().length; List methodInfoList = methodsInfoMap.get(parameterLength); if (methodInfoList = null) methodInfoList = new LinkedList(); methodsInfoMap.put(parameterLength, methodInfoList); methodInfoList.add(new Meth

27、odInfo(method); maxParameterLength = Math.max(maxParameterLength, parameterLength); MethodInfo methods = new MethodInfomaxParameterLength + 1; for (int i = 0; i methods.length; +i) List methodInfoList = methodsInfoMap.get(i); if (methodInfoList = null | methodInfoList.size() = 0) methodsi = EMPTY_ME

28、THODS; else methodsi = methodInfoList.toArray(new MethodInfomethodInfoList.size(); return methods; MethodInfo getMethods(int parameterLength) if (parameterLength methods.length) return methodsparameterLength; return EMPTY_METHODS; public String toString() StringBuilder buffer = new StringBuilder();

29、for (int i = 0; i methods.length; +i) buffer.append(i).append(t) .append(Arrays.toString(methodsi).append(n); return buffer.toString(); static class MethodInfo final Method method; ParameterTypes parameterTypes; / cache MethodInfo(Method method) this.method = method; Method getMethod() return method; ParameterTypes getParamete

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2