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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

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

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

1、 byte.class) Byte.class) String.class) /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 java.lang.reflect.InvocationTargetException;import java.lang.reflect.Method; *

2、 author canghailan 2012-01-13 23:06public class Methods private static final MethodLookup publicLookup = new MethodLookup(1024); public static MethodLookup publicLookup() return publicLookup; public static Object invoke(Object object, String name, Object. params) throws NoSuchMethodException, Invoca

3、tionTargetException, IllegalAccessException Method method = publicLookup.findMethod( object.getClass(), name, MethodLookup.getParameterTypes(params) if (method != null) return method.invoke(object, params); throw new NoSuchMethodException(invokeToString(object.getClass(), name, params); public stati

4、c Object invokeStatic(Class clazz, String name, Object. params) clazz, 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();

5、 buffer.append(clazz.getName().append($); buffer.append(method).append( for (Object param : params) buffer.append(param).append(, buffer.setLength(buffer.length() - .length(); buffer.append() return buffer.toString();文件 Fields.java4KBimport java.lang.reflect.Field;import java.lang.reflect.Modifier;p

6、ublic class Fields private static final FieldLookup lookup = new FieldLookup(1024); public static FieldLookup lookup() return lookup; public static Object get(Object object, String field) Method getter = lookup.findGetter(object.getClass(), field); if (getter ! return getter.invoke(object); throw ne

7、w NoSuchMethodException(Could not find getter for + object.getClass().getName() + . + field); public static void set(Object object, String field, Object value) StringBuilder buffer = new StringBuilder(set.length() + field.length(); buffer.append().append(field) .setCharAt(.length(), Character.toUppe

8、rCase(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 ! return directGet(object, field); throw new NoSu

9、chFieldException(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.setAccessible(false); return val

10、ue; public static void directSet(Object object, String name, Object value) directSet(object, field, value); public static void directSet(Object object, Field field, Object value) field.set(object, value); public static void copy(Object src, Object dst, String. fieldNames) throws NoSuchFieldException

11、, IllegalAccessException, InvocationTargetException, NoSuchMethodException if (src.getClass().equals(dst.getClass() for (String fieldName : fieldNames) Field field = lookup.findField(src.getClass(), fieldName); if (field = null) throw new NoSuchFieldException(src.getClass().getName() + + fieldName);

12、 directSet(dst, field, directGet(src, field); for (String name : set(dst, name, get(src, name); public static void copy(T src, T dst) throws IllegalAccessException for (Class clz = src.getClass(); clz != null; clz = clz.getSuperclass() for (Field field : clz.getDeclaredFields() / skip static and fin

13、al field if (Modifier.isStatic(field.getModifiers() | Modifier.isFinal(field.getModifiers() continue;文件 MethodLookup.java12KBimport java.util.*; * author canghailan 2012-02-23 20:31public class MethodLookup extends CachedLookup implements MemberLookup public static final Class EMPTY_CLASSES = new Cl

14、ass0; public MethodLookup(Map cache) super(cache); public MethodLookup(final int cacheSize) super(cacheSize); Override protected MethodsInfo doFind(Identifier key) return new MethodsInfo(key.getClazz(), key.getName(); public Method findMethod(Class 0) if (accept = null | methodInfo.isMorePrecise(acc

15、ept) accept = methodInfo; return accept = null ? null : accept.getMethod(); /* * linull = nullobject = object.getClass() public static Class getParameterTypes(Object. params) if (params = null) return null; if (params.length = 0) return EMPTY_CLASSES; Class types = new Classparams.length; for (int i

16、 = 0; i params.length; +i) typesi = paramsi = null ? paramsi.getClass(); return types; static class MethodsInfo static final MethodInfo EMPTY_METHODS = new MethodInfo0; final MethodInfo methods; MethodsInfo(Class clazz, String name) methods = generateMethodsInfo(clazz, name); MethodInfo generateMeth

17、odsInfo(Class int maxParameterLength = 0; MapInteger, List methodsInfoMap = new HashMap(); for (Method method : clazz.getMethods() if (method.getName().equals(name) int parameterLength = method.getParameterTypes().length; List methodInfoList = methodsInfoMap.get(parameterLength); if (methodInfoList

18、= null) methodInfoList = new LinkedList methodsInfoMap.put(parameterLength, methodInfoList); methodInfoList.add(new MethodInfo(method); maxParameterLength = Math.max(maxParameterLength, parameterLength); MethodInfo methods = new MethodInfomaxParameterLength + 1; methods.length; methodInfoList = meth

19、odsInfoMap.get(i); if (methodInfoList = null | methodInfoList.size() = 0) methodsi = EMPTY_METHODS; methodsi = methodInfoList.toArray(new MethodInfomethodInfoList.size(); return methods; MethodInfo getMethods(int parameterLength) if (parameterLength methods.length) return methodsparameterLength; ret

20、urn EMPTY_METHODS; public String toString() buffer.append(i).append(t) .append(Arrays.toString(methodsi).append(n 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