精华内容
下载资源
问答
  • commons-codec项目 org.apache.commons.codec.digest.DigestUtils sha256Hex(String data) guava项目(谷歌核心模块) Guava工程是Google开发Java核心依赖库,例如:集合 [collections] 、缓存 [caching] 、...

    Java原生

    格式化double数值,只保留两位小数

    NumberFormat fromat=new DecimalFormat("0.00");

    format.format(doublexx);

    commons-codec项目

    org.apache.commons.codec.digest.DigestUtils类

    sha256Hex(String data)

     

    guava项目(谷歌核心模块)

    Guava工程是Google开发的Java核心依赖库,例如:集合 [collections] 、缓存 [caching] 、原生类型支持 [primitives support] 、并发库 [concurrency libraries] 、通用注解 [common annotations] 、字符串处理 [string processing] 、I/O ,消息总线[eventbus]等等。

    com.google.guava.Strings类:

    isNullOrEmpty()  //判断字符串是“”或者null

     

    com.google.common.collect.Ordering类

     

     

    com.goole.common.base.Splitter类:

      1. 将字符串转化为list

    str="1-2-3-4- 5-  6  ";

    List<String> list = Splitter.on("-").omitEmptyStrings().trimResults().splitToList(str);//可以获得1,2..6的list

    2支持将字符串转化为map

    String str = "xiaoming=11,xiaohong=23";
    Map<String,String> map = Splitter.on(",").withKeyValueSeparator("=").split(str);

    3支持字符串切割,并支持正则表达式

    String input = "aa.dd,,ff,,.";
    List<String> result = Splitter.onPattern("[.|,]").omitEmptyStrings().splitToList(input);

    SpringFramework-core项目

    base64:org.springframwork.util.Base64Utils

     

    MD5加密:org.springframework.util.DigestUtils

     

    org.springframework.cglib.beans.BeanCopier

     

    org.springframework.beans.BeanUtils  注意和common.lang的beanUtils拷贝顺序相反

    instantiateClass函数,可以根据class初始化对象

    spring-retry项目

    org.springframework.retry.RetryTemplate 可以针对回调失败的通知进行多次重试

     

    spring-expression 项目

    Expression接口可以获得表达式然后匹配数据

     

     

     

     

     

     

    展开全文
  • android常见的一些工具类的方法

    千次阅读 2014-07-07 22:42:52
    * 获取屏幕宽高 * * @param con * @return */ public static int[] getScreenParams(Context con) { WindowManager manager = ((Activity) con).getWindowManager(); return new int[] { manager...
    /**
    	 * 获取屏幕的宽高
    	 * 
    	 * @param con
    	 * @return
    	 */
    	public static int[] getScreenParams(Context con) {
    
    		WindowManager manager = ((Activity) con).getWindowManager();
    		return new int[] { manager.getDefaultDisplay().getWidth(),
    				manager.getDefaultDisplay().getHeight() };
    	}
    
    	/**
    	 * 重置图片大小
    	 * 
    	 * @param c
    	 */
    	public static Bitmap resizeBitmap(Context c, String path) {
    
    		int windowWidth = ((Activity) c).getWindowManager().getDefaultDisplay()
    				.getWidth();
    		int windowHeight = ((Activity) c).getWindowManager()
    				.getDefaultDisplay().getHeight();
    
    		// 图片解析的配置
    		BitmapFactory.Options options = new Options();
    		// 不去真的解析图片,只是获取图片的头部信息宽,高
    		options.inJustDecodeBounds = true;
    		BitmapFactory.decodeFile(path, options);
    		int imageHeight = options.outHeight;
    		int imageWidth = options.outWidth;
    		// 计算缩放比例
    		int scaleX = imageWidth / windowWidth;
    		int scaleY = imageHeight / windowHeight;
    		int scale = 1;
    		if (scaleX > scaleY & scaleY >= 1) {
    			scale = scaleX;
    
    		} else if (scaleY > scaleX & scaleX >= 1) {
    			scale = scaleY;
    
    		}
    		// 真的解析图片
    		options.inJustDecodeBounds = false;
    		// 设置采样率
    		options.inSampleSize = scale;
    		Bitmap bitmap = BitmapFactory.decodeFile(path, options);
    
    		return bitmap;
    	}
    
    	/**
    	 * 半角转换为全角
    	 * 
    	 * @param input
    	 * @return ddddddd
    	 */
    	public static String ToDBC(String input) {
    		char[] c = input.toCharArray();
    		for (int i = 0; i < c.length; i++) {
    			if (c[i] == 12288) {
    				c[i] = (char) 32;
    				continue;
    			}
    			if (c[i] > 65280 && c[i] < 65375)
    				c[i] = (char) (c[i] - 65248);
    		}
    		return new String(c);
    	}
    
    	public static String object2String(Object obj) {
    
    		String result = "";
    		if (obj != null) {
    
    			result = String.valueOf(obj);
    		}
    
    		return result;
    	}
    
    	/**
    	 * 字符串转换成int
    	 * 
    	 * @param str
    	 *            字符串参数
    	 * @return
    	 */
    	public static int String2int(String str) {
    
    		if (str != null && !str.equals("")) {
    
    			return Integer.parseInt(str);
    		}
    
    		return -1;
    	}
    
    	/**
    	 * 解析json数据插入数据库
    	 * 
    	 * @param context
    	 * 
    	 */
    	public static String readData(Context context, int id) {
    
    		InputStream in = context.getResources().openRawResource(id);
    		// 将in读入reader 中
    		BufferedReader br;
    		try {
    			br = new BufferedReader(new InputStreamReader(in, "GBK"));
    
    			StringBuffer buffer = new StringBuffer("");
    			String tem = "";
    			while ((tem = br.readLine()) != null) {
    				buffer.append(tem);
    			}
    			br.close();
    
    			return buffer.toString();
    		} catch (UnsupportedEncodingException e) {
    
    			e.printStackTrace();
    		} catch (IOException e) {
    
    			e.printStackTrace();
    		}
    		return null;
    	}
    
    	/**
    	 * 检查当前手机网络
    	 * 
    	 * @param context
    	 * @return
    	 */
    	public static boolean isNetConnected(Context context) {
    		// 判断连接方式
    		boolean wifiConnected = isWifiConnected(context);
    		boolean mobileConnected = isMobileConnected(context);
    		if (wifiConnected == false && mobileConnected == false) {
    			// 如果都没有连接返回false,提示用户当前没有网络
    			return false;
    		}
    		return true;
    	}
    
    	// 判断手机使用是wifi还是mobile
    	/**
    	 * 判断手机是否采用wifi连接
    	 */
    	public static boolean isWifiConnected(Context context) {
    		// Context.CONNECTIVITY_SERVICE).
    
    		ConnectivityManager manager = (ConnectivityManager) context
    				.getSystemService(Context.CONNECTIVITY_SERVICE);
    		NetworkInfo networkInfo = manager
    				.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
    		if (networkInfo != null && networkInfo.isConnected()) {
    			return true;
    		}
    		return false;
    	}
    
    	/**
    	 * 手机移动网络是否连接
    	 * 
    	 * @param context
    	 * @return
    	 */
    	public static boolean isMobileConnected(Context context) {
    		ConnectivityManager manager = (ConnectivityManager) context
    				.getSystemService(Context.CONNECTIVITY_SERVICE);
    		NetworkInfo networkInfo = manager
    				.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
    		if (networkInfo != null && networkInfo.isConnected()) {
    			return true;
    		}
    		return false;
    	}
    
    	/**
    	 * 显示Toast提示框
    	 * 
    	 * @param context
    	 * @param msg
    	 *            提示内容
    	 */
    	public static void showToast(Context context, String msg) {
    
    		Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
    	}
    
    	/**
    	 * 显示Toast提示框
    	 * 
    	 * @param context
    	 * @param stringId
    	 *            stringid
    	 */
    	public static void showToast(Context context, int stringId) {
    
    		Toast.makeText(context, context.getString(stringId), Toast.LENGTH_SHORT)
    				.show();
    	}
    
    	/**
    	 * 根据手机的分辨率从 dp 的单位 转成为 px(像素)
    	 */
    	public static int dip2px(Context context, float dpValue) {
    		final float scale = context.getResources().getDisplayMetrics().density;
    		return (int) (dpValue * scale + 0.5f);
    	}
    
    	/**
    	 * 根据手机的分辨率从 px(像素) 的单位 转成为 dp
    	 */
    	public static int px2dip(Context context, float pxValue) {
    		final float scale = context.getResources().getDisplayMetrics().density;
    		return (int) (pxValue / scale + 0.5f);
    	}
    
    	/**
    	 * 获取当前时间
    	 * 
    	 * @param pattern
    	 * @return
    	 */
    	public static String getCurrentDate(String pattern) {
    
    		SimpleDateFormat dateFormat = new SimpleDateFormat(pattern);
    		return dateFormat.format(new Date());
    	}
    
    	/**
    	 * 格式化时间字符串
    	 * 
    	 * @return String
    	 */
    	public static String formatDate(Date date) {
    		if (date == null)
    			date = new Date();
    		String code = new String();
    		SimpleDateFormat matter = new SimpleDateFormat("MM月dd日 HH:mm");
    		code = matter.format(date);
    		return code;
    	}
    
    	/**
    	 * 测试是否是Email地址
    	 * 
    	 * @param email地址
    	 * @return 测试结果
    	 */
    	public static boolean testEmail(String email) {
    
    		String regex = "^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\\.([a-zA-Z0-9_-])+)+$";
    
    		return email.matches(regex);
    	}
    
    	/**
    	 * JSON字符串去掉最外层[]
    	 * 
    	 * @param str
    	 * @return
    	 */
    	public static String deleteMark(String str) {
    
    		int start = str.indexOf("[");
    		if (start == 0) {
    			int end = str.lastIndexOf("]");
    
    			return str.substring(start + 1, end);
    		}
    
    		return str;
    	}
    
    	/**
    	 * 利用反射给对象赋值
    	 * 
    	 * @param obj
    	 * @param cursor
    	 */
    	public static void setClassValueBycursor(Object obj, Cursor cursor) {
    		int ColCount = cursor.getColumnCount();
    		int i = 0;
    		for (i = 0; i < ColCount; i++) {
    			String ColName = cursor.getColumnName(i);
    
    			try {
    				Field f = obj.getClass().getField(ColName);
    				String ret = cursor.getString(i);
    				if (f == null)
    					continue;
    				if (ret == null)
    					ret = "";
    				f.set(obj, ret);
    			} catch (SecurityException e) {
    				// TODO Auto-generated catch block
    				e.printStackTrace();
    			} catch (NoSuchFieldException e) {
    				// TODO Auto-generated catch block
    				e.printStackTrace();
    			} catch (IllegalArgumentException e) {
    				// TODO Auto-generated catch block
    				e.printStackTrace();
    			} catch (IllegalAccessException e) {
    				// TODO Auto-generated catch block
    				e.printStackTrace();
    			}
    		}
    	}
    
    	/**
    	 * 进入画面时,关闭键盘
    	 * 
    	 * @param context
    	 */
    	public static void closeWhenOncreate(Context context) {
    
    		// SOFT_INPUT_STATE_ALWAYS_VISIBLE 键盘始终显示
    		((Activity) context).getWindow().setSoftInputMode(
    				WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
    	}
    
    	/**
    	 * 
    	 * @param context
    	 *            view所在activity
    	 * @param view
    	 *            当前activity中获取焦点的view
    	 */
    	public static void closeKeyboardForCommonAct(Context context, View view) {
    		InputMethodManager imm = (InputMethodManager) ((Activity) context)
    				.getSystemService(Context.INPUT_METHOD_SERVICE);
    		if (((Activity) context).getCurrentFocus().getWindowToken() != null) {
    			imm.hideSoftInputFromInputMethod(view.getWindowToken(),
    					InputMethodManager.HIDE_NOT_ALWAYS);
    		}
    	}
    
    	/**
    	 * 普通关闭
    	 * 
    	 * @param context
    	 */
    	public static void closeKeyboardCommAct(Context context) {
    
    		InputMethodManager imm = (InputMethodManager) ((Activity) context)
    				.getSystemService(Context.INPUT_METHOD_SERVICE);
    
    		if (((Activity) context).getCurrentFocus() != null) {
    			imm.hideSoftInputFromWindow(((Activity) context).getCurrentFocus()
    					.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
    		}
    
    	}
    
    	/**
    	 * 全角转换成半角,适应屏幕:TextView换行时,全角和半角导致显示混乱。 /全角空格为12288,半角空格为32 /其他字符半角(33
    	 * -126)与全角(65281- 65374)的对应关系是:均相差65248
    	 * 
    	 * @param input
    	 * @return
    	 */
    	public static String changeQuanj2Banj(String input) {
    
    		char[] c = input.toCharArray();
    
    		for (int i = 0; i < c.length; i++) {
    			if (c[i] == 12288) {
    				c[i] = (char) 32;
    			}
    			if (c[i] > 65280 && c[i] < 65375) {
    
    				c[i] = (char) (c[i] - 65248);
    			}
    		}
    		return String.valueOf(c);
    
    	}
    
    	/**
    	 * 检查sd卡是否可用
    	 * 
    	 * @return
    	 */
    	public static boolean checkSDCardAvaliable() {
    
    		if (Environment.getExternalStorageState() == Environment.MEDIA_REMOVED) {
    
    			return false;
    		}
    
    		return true;
    
    	}
    
    	/**
    	 * 检查是否为数字,包括含小数点的
    	 * 
    	 * @param str
    	 * @return
    	 */
    	public static boolean isNumeric(String str) {
    		Pattern pattern = Pattern.compile("(([+\\-])?(\\d+)?)?(\\.(\\d+)?)?$");// (([+\\-])?(\\d+)?)?(\\.(\\d+)?)?$
    		Matcher isNum = pattern.matcher(str);
    		if (!isNum.matches()) {
    			return false;
    		}
    		return true;
    	}
    
    	/**
    	 * 检查指定服务是否在运行
    	 * 
    	 * @param context
    	 * @param serviceName
    	 * @return
    	 */
    	public static boolean IsServiceRunning(Context context, String serviceName) {
    
    		ActivityManager activityManage = (ActivityManager) context
    				.getSystemService(Context.ACTIVITY_SERVICE);
    
    		List<ActivityManager.RunningServiceInfo> serviceList = activityManage
    				.getRunningServices(30);
    
    		for (ActivityManager.RunningServiceInfo info : serviceList) {
    
    			if (info.service.getClassName().equals(serviceName)) {
    
    				return true;
    			} else {
    				continue;
    			}
    		}
    
    		return false;
    	}
    
    	/**
    	 * 按照特定尺寸计算图片缩放值。倍数
    	 * 
    	 * @param options
    	 * @param reqWidth
    	 * @param reqHeight
    	 * @return
    	 */
    	public static int calculateInSampleSize(BitmapFactory.Options options,
    			int reqWidth, int reqHeight) {
    		// 原始图片的宽高
    		final int height = options.outHeight;
    		final int width = options.outWidth;
    		int inSampleSize = 1;
    
    		if (height > reqHeight || width > reqWidth) {
    
    			final int halfHeight = height / 2;
    			final int halfWidth = width / 2;
    
    			// 在保证解析出的bitmap宽高分别大于目标尺寸宽高的前提下,取可能的inSampleSize的最大值
    			while ((halfHeight / inSampleSize) > reqHeight
    					&& (halfWidth / inSampleSize) > reqWidth) {
    				inSampleSize *= 2;
    			}
    		}
    
    		return inSampleSize;
    	}
    
    	/**
    	 * 根据resid获取图片
    	 * 
    	 * @param res
    	 * @param resId
    	 * @param reqWidth
    	 * @param reqHeight
    	 * @return
    	 */
    	public static Bitmap decodeSampledBitmapFromResource(Resources res,
    			int resId, int reqWidth, int reqHeight) {
    
    		// 首先设置 inJustDecodeBounds=true 来获取图片尺寸
    		final BitmapFactory.Options options = new BitmapFactory.Options();
    		options.inJustDecodeBounds = true;
    		BitmapFactory.decodeResource(res, resId, options);
    
    		// 计算 inSampleSize 的值
    		options.inSampleSize = calculateInSampleSize(options, reqWidth,
    				reqHeight);
    
    		// 根据计算出的 inSampleSize 来解码图片生成Bitmap
    		options.inJustDecodeBounds = false;
    		return BitmapFactory.decodeResource(res, resId, options);
    	}



    /**
     * 对文件操作的工具类。
     * @author 
     *
     */
    public class FileUtil {
    
    	/**
    	 * 获取文件名称
    	 * 
    	 * @param str
    	 * @return
    	 */
    	public static String getFileName(String str) {
    		// 去除url中的符号作为文件名返回
    		str = str.replaceAll("(?i)[^a-zA-Z0-9\u4E00-\u9FA5]", "");
    		System.out.println("filename = " + str);
    		return str + ".png";
    	}
    
    	/**
    	 * 将文件保存至sd卡
    	 * 
    	 * @param fileName
    	 * @param inputStream
    	 */
    	public static void writeSDcard(String fileName, InputStream inputStream) {
    		try {
    			File file = new File(Constants.DOWNLOAD_PATH);
    			if (!file.exists()) {
    				file.mkdirs();
    			}
    
    			FileOutputStream fileOutputStream = new FileOutputStream(
    					Constants.DOWNLOAD_PATH + fileName);
    			byte[] buffer = new byte[512];
    			int count = 0;
    			while ((count = inputStream.read(buffer)) > 0) {
    				fileOutputStream.write(buffer, 0, count);
    			}
    			fileOutputStream.flush();
    			fileOutputStream.close();
    			inputStream.close();
    			System.out.println("writeToSD success");
    		} catch (IOException e) {
    			e.printStackTrace();
    			System.out.println("writeToSD fail");
    		}
    	}
    
    	/**
    	 * 将文件保存到sd卡
    	 * 
    	 * @param fileName
    	 *            文件完整路径
    	 * @param inputStream
    	 * @return
    	 */
    	public static boolean writeFile2SDcard(String fileName,
    			InputStream inputStream) {
    		try {
    			if (null == inputStream) {
    
    				return false;
    			}
    
    			File file = new File(Constants.DOWNLOAD_PATH);
    			if (!file.exists()) {
    				file.mkdirs();
    			}
    
    			FileOutputStream fileOutputStream = new FileOutputStream(fileName);
    			byte[] buffer = new byte[1024];
    			int count = 0;
    			while ((count = inputStream.read(buffer)) > 0) {
    				fileOutputStream.write(buffer, 0, count);
    			}
    			fileOutputStream.flush();
    			fileOutputStream.close();
    			inputStream.close();
    			System.out.println("writeToSD success");
    			return true;
    		} catch (IOException e) {
    			e.printStackTrace();
    			System.out.println("writeToSD fail");
    			return false;
    		}
    	}
    
    	/**
    	 * 保存图片到sd卡
    	 * 
    	 * @param fileName 文件名称
    	 * @param bmp 对应的图片Bitmap
    	 * @return
    	 */
    	public static boolean writeBitmap2SDcard(String fileName, Bitmap bmp) {
    		try {
    			File file = new File(Constants.DOWNLOAD_PATH);
    			if (!file.exists()) {
    				//判断是否存在下载目录
    				file.mkdirs();
    			}
    			InputStream is = bitmap2InputStream(bmp);
    
    			File imgFile = new File(Constants.DOWNLOAD_PATH
    					+ getFileName(fileName));
    			if (!imgFile.exists()) {
    
    				imgFile.createNewFile();
    			}
    
    			FileOutputStream fileOutputStream = new FileOutputStream(imgFile);
    			byte[] buffer = new byte[512];
    			int count = 0;
    			while ((count = is.read(buffer)) > 0) {
    				fileOutputStream.write(buffer, 0, count);
    			}
    			fileOutputStream.flush();
    			fileOutputStream.close();
    			is.close();
    			System.out.println("writeToSD success");
    		} catch (IOException e) {
    			e.printStackTrace();
    			System.out.println("writeToSD fail");
    			return false;
    		}
    		return true;
    	}
    
    	/**
    	 * // Bitmap转换成byte[]
    	 * 
    	 * @param bm  目标Bitmap
    	 * @return
    	 */
    	public static byte[] bitmap2Bytes(Bitmap bm) {
    		ByteArrayOutputStream baos = new ByteArrayOutputStream();
    		bm.compress(Bitmap.CompressFormat.PNG, 100, baos);
    		return baos.toByteArray();
    	}
    
    	/**
    	 * // 将Bitmap转换成InputStream
    	 * 
    	 * @param bm
    	 * @return
    	 */
    	public static InputStream bitmap2InputStream(Bitmap bm) {
    		ByteArrayOutputStream baos = new ByteArrayOutputStream();
    		bm.compress(Bitmap.CompressFormat.PNG, 100, baos);
    		InputStream is = new ByteArrayInputStream(baos.toByteArray());
    		return is;
    	}
    
    	/**
    	 * 将输入流转换成字节数组
    	 * @param is 输入流
    	 * @return
    	 */
    	public static byte[] changeIs2ByteArr(InputStream is) {
    		try {
    
    			ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
    			int len = -1;
    			byte b[] = new byte[2048];
    			while ((len = is.read(b)) != -1) {
    
    				byteArrayOutputStream.write(b, 0, len);
    
    			}
    			return byteArrayOutputStream.toByteArray();
    		} catch (IOException e) {
    
    			e.printStackTrace();
    		}
    
    		return null;
    	}
    
    	/**
    	 * 查看文件是否存在
    	 * 
    	 * @param path 文件路径
    	 * @return
    	 */
    	public static boolean isFileExist(String path) {
    
    		File file = new File(path);
    
    		if (file.exists()) {
    
    			return true;
    		}
    		return false;
    	}
    
    	/**
    	 * 格式化文件大
    	 * 
    	 * @param volume
    	 *            文件大小
    	 * @return 格式化的字符
    	 */
    	public static String getVolume(long volume) {
    
    		float num = 1.0F;
    
    		String str = null;
    
    		if (volume < 1024) {
    			str = volume + "B";
    		} else if (volume < 1048576) {
    			num = num * volume / 1024;
    			str = String.format("%.1f", num) + "K";
    		} else if (volume < 1073741824) {
    			num = num * volume / 1048576;
    			str = String.format("%.1f", num) + "M";
    		} else if (volume < 1099511627776L) {
    			num = num * volume / 1073741824;
    			str = String.format("%.1f", num) + "G";
    		}
    
    		return str;
    	}

    /**
     * 
     * <p>
     * 网网络下载文件(图片,附件,视频等)
     * </p>
     * 
     * 
     */
    public class HttpDownloadFile {
    
    	/**
    	 * 获取文件输入流
    	 * 
    	 * @param httpUrl  网络路径
    	 * @return
    	 */
    	public static InputStream getInputstream(String httpUrl) {
    		URL url = null;
    		InputStream is = null;
    		try {
    			url = new URL(httpUrl);
    
    			HttpURLConnection connection = (HttpURLConnection) url
    					.openConnection();
    
    			connection.setConnectTimeout(5 * 1000);
    			if (connection.getResponseCode() == 200) {
    				is = connection.getInputStream();
    			}
    
    		} catch (MalformedURLException e) {
    
    			e.printStackTrace();
    		} catch (IOException e) {
    
    			e.printStackTrace();
    		}
    
    		return is;
    	}
    
    	/**
    	 * 网络获取图片
    	 * 
    	 * @param url 图片的网络路径
    	 * @return
    	 */
    	public static Bitmap httpGetBmp(String url) {
    		HttpGet httpget = new HttpGet(url);
    		BasicHttpParams httpParams = new BasicHttpParams();
    		HttpConnectionParams.setConnectionTimeout(httpParams, 10000);
    		HttpConnectionParams.setSoTimeout(httpParams, 10000);
    		Bitmap bitmap = null;
    		try {
    			HttpClient httpclient = new DefaultHttpClient(httpParams);
    			HttpResponse response = httpclient.execute(httpget);
    			InputStream is = response.getEntity().getContent();
    			byte[] bytes = new byte[1024];
    			ByteArrayOutputStream bos = new ByteArrayOutputStream();
    			int count = 0;
    			while ((count = is.read(bytes)) != -1) {
    				System.out.println("readBitmap");
    				bos.write(bytes, 0, count);
    			}
    			byte[] byteArray = bos.toByteArray();
    			bitmap = BitmapFactory.decodeByteArray(byteArray, 0,
    					byteArray.length);
    			is.close();
    			bos.close();
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
    		return bitmap;
    	}


    展开全文
  • /// 工具条拥有者标识,单据主工具条不用传值,表格工具条请传表格标识,其它独立工具条请传工具条标识 public static void SetBarEnabled(this IDynamicFormView view, bool bEnabled, string barOwnerKey = "") ...
    public static class CommonUtil
        {
            /// <summary>
            /// 显示表单
            /// </summary>
            /// <param name="view"></param>
            /// <param name="panelKey"></param>
            /// <returns></returns>
            public static void ShowForm(this IDynamicFormView view, string formId, string panelKey = null, string pageId = null, Action<FormResult> callback = null, Action<DynamicFormShowParameter> showParaCallback = null)
            {
                DynamicFormShowParameter showPara = new DynamicFormShowParameter();
                showPara.PageId = string.IsNullOrWhiteSpace(pageId) ? Guid.NewGuid().ToString() : pageId;
                showPara.ParentPageId = view.PageId;
                if (string.IsNullOrWhiteSpace(panelKey))
                {
                    showPara.OpenStyle.ShowType = ShowType.Default;
                }
                else
                {
                    showPara.OpenStyle.ShowType = ShowType.InContainer;
                    showPara.OpenStyle.TagetKey = panelKey;
                }
                showPara.FormId = formId;
                showPara.OpenStyle.CacheId = pageId;
                if (showParaCallback != null)
                {
                    showParaCallback(showPara);
                }
    
                view.ShowForm(showPara, callback);
            }
    
            /// <summary>
            /// 显示列表
            /// </summary>
            /// <param name="view"></param>
            /// <param name="formId"></param>
            /// <param name="listType"></param>
            /// <param name="bMultiSel"></param>
            /// <param name="callback"></param>
            public static void ShowList(this IDynamicFormView view, string formId, BOSEnums.Enu_ListType listType, bool bMultiSel = true, string filter = "", Action<ListShowParameter> showPara = null, Action<FormResult> callback = null)
            {
                ListShowParameter listShowPara = new ListShowParameter();
                listShowPara.FormId = formId;
                listShowPara.PageId = Guid.NewGuid().ToString();
                listShowPara.ParentPageId = view.PageId;
                listShowPara.MultiSelect = bMultiSel;
                listShowPara.ListType = (int)listType;
                if (listType == BOSEnums.Enu_ListType.SelBill)
                {
                    listShowPara.IsLookUp = true;
                }
                listShowPara.ListFilterParameter.Filter = listShowPara.ListFilterParameter.Filter.JoinFilterString(filter);
                listShowPara.IsShowUsed = true;
                listShowPara.IsShowApproved = false;
                if (showPara != null) showPara(listShowPara);
    
                view.ShowForm(listShowPara, callback);
            }
    
            /// <summary>
            /// 设置某个实体整体可用性
            /// </summary>
            /// <param name="view"></param>
            /// <param name="entityKey"></param>
            /// <param name="bEnabled"></param>
            public static void SetEntityEnabled(this IDynamicFormView view, string entityKey, bool bEnabled)
            {
                EntityAppearance entityAp = view.LayoutInfo.GetEntityAppearance(entityKey);
                if (entityAp == null) return;
                foreach (var ap in entityAp.Layoutinfo.Controls)
                {
                    view.StyleManager.SetEnabled(ap, null, bEnabled);
                }
            }
    
            /// <summary>
            /// 设置行可用性
            /// </summary>
            /// <param name="view"></param>
            /// <param name="entityKey"></param>
            /// <param name="row"></param>
            /// <param name="bEnabled"></param>
            /// <param name="exceptFieldkeys"></param>
            public static void SetEntityRowEnabled(this IDynamicFormView view, string entityKey, int row, bool bEnabled, IEnumerable<string> exceptFieldkeys = null)
            {
                Entity entity = view.BillBusinessInfo.GetEntity(entityKey);
                DynamicObject rowObj = view.Model.GetEntityDataObject(entity, row);
    
                SetEntityRowEnabled(view, entityKey, rowObj, bEnabled, exceptFieldkeys);
            }
    
            /// <summary>
            /// 设置行可用性
            /// </summary>
            /// <param name="view"></param>
            /// <param name="entityKey"></param>
            /// <param name="rowObject"></param>
            /// <param name="bEnabled"></param>
            /// <param name="exceptFieldkeys"></param>
            public static void SetEntityRowEnabled(this IDynamicFormView view, string entityKey, DynamicObject rowObject, bool bEnabled, IEnumerable<string> exceptFieldkeys = null)
            {
                if (exceptFieldkeys == null) exceptFieldkeys = new string[] { };
    
                foreach (Field field in (from o in view.BillBusinessInfo.GetEntryEntity(entityKey).Fields
                                         where !exceptFieldkeys.Contains(o.Key)
                                         select o).ToList<Field>())
                {
                    view.StyleManager.SetEnabled(field, rowObject, null, bEnabled);
                }
            }
    
            /// <summary>
            /// 设置工具条整体可用状态
            /// </summary>
            /// <param name="view"></param>
            /// <param name="bEnabled">可用性</param>
            /// <param name="barOwnerKey">工具条拥有者标识,单据主工具条不用传值,表格工具条请传表格标识,其它独立工具条请传工具条标识</param>
            public static void SetBarEnabled(this IDynamicFormView view, bool bEnabled, string barOwnerKey = "")
            {
                if (string.IsNullOrWhiteSpace(barOwnerKey))
                {
                    FormAppearance formAppearance = view.LayoutInfo.GetFormAppearance();
                    if (((formAppearance.Menu != null) && !string.IsNullOrWhiteSpace(formAppearance.Menu.Id)) && (formAppearance.ShowMenu == 1))
                    {
                        foreach (var item in formAppearance.Menu.GetAllBarItems())
                        {
                            view.SetBarItemEnabled(item.Key, bEnabled, barOwnerKey);
                        }
                    }
                }
                else
                {
                    EntryEntityAppearance appearance3 = view.LayoutInfo.GetEntryEntityAppearance(barOwnerKey);
                    if ((appearance3 != null) && (appearance3.Menu != null))
                    {
                        foreach (var item in appearance3.Menu.GetAllBarItems())
                        {
                            view.SetBarItemEnabled(item.Key, bEnabled, barOwnerKey);
                        }
                    }
    
                    ToolBarCtrlAppearance appearance4 = view.LayoutInfo.GetToolbarCtrlAppearances().FirstOrDefault(o => o.Key == barOwnerKey);
                    if ((appearance4 != null) && (appearance4.Menu != null))
                    {
                        foreach (var item in appearance4.Menu.GetAllBarItems())
                        {
                            view.SetBarItemEnabled(item.Key, bEnabled, barOwnerKey);
                        }
                    }
                }
    
            }
    
            /// <summary>
            /// 设置按钮可用状态
            /// </summary>
            /// <param name="view"></param>
            /// <param name="barItemKey">按钮标识</param>
            /// <param name="bEnabled">可用性</param>
            /// <param name="barOwnerKey">工具条拥有者标识,单据主工具条不用传值,表格工具条请传表格标识,其它独立工具条请传工具条标识</param>
            public static void SetBarItemEnabled(this IDynamicFormView view, string barItemKey, bool bEnabled, string barOwnerKey = "")
            {
                Appearance ap = null;
                if (!string.IsNullOrWhiteSpace(barOwnerKey))
                    ap = view.LayoutInfo.GetAppearance(barOwnerKey);
    
                BarItemControl barItem = null;
                if (ap == null)
                {
                    barItem = view.GetMainBarItem(barItemKey);
    
                    if (barItem != null)
                    {
                        barItem.Enabled = bEnabled;
                    }
                }
    
                foreach (var entityAp in view.LayoutInfo.GetEntityAppearances())
                {
                    if (entityAp is HeadEntityAppearance || entityAp is SubHeadEntityAppearance) continue;
    
                    if (barOwnerKey.IsNullOrEmptyOrWhiteSpace() || entityAp.Key.EqualsIgnoreCase(barOwnerKey))
                    {
                        barItem = view.GetBarItem(entityAp.Key, barItemKey);
    
                        if (barItem != null)
                        {
                            barItem.Enabled = bEnabled;
                        }
                    }
                }
                
            }
    
            /// <summary>
            /// 设置按钮可见状态
            /// </summary>
            /// <param name="view"></param>
            /// <param name="barItemKey">按钮标识</param>
            /// <param name="bVisible">可见性</param>
            /// <param name="barOwnerKey">工具条拥有者标识,单据主工具条不用传值,表格工具条请传表格标识,其它独立工具条请传工具条标识</param>
            public static void SetBarItemVisible(this IDynamicFormView view, string barItemKey, bool bVisible, string barOwnerKey = "")
            {
                Appearance ap = null;
                if (!string.IsNullOrWhiteSpace(barOwnerKey))
                    ap = view.LayoutInfo.GetAppearance(barOwnerKey);
    
                BarItemControl barItem = null;
                if (ap == null)
                {
                    barItem = view.GetMainBarItem(barItemKey);
                }
                else
                {
                    barItem = view.GetBarItem(ap.Key, barItemKey);
                }
                if (barItem != null)
                {
                    barItem.Visible = bVisible;
                }
            }
    
            /// <summary>
            /// 更新可视元素宽度
            /// </summary>
            /// <param name="formState"></param>
            /// <param name="key"></param>
            /// <param name="width"></param>
            public static void UpdateColumnWidth(this IDynamicFormView view, ControlAppearance gridAp, string colKey, int width)
            {
                IDynamicFormState formState = view.GetService<IDynamicFormState>();
                //SetFieldPropValue(formState, ctlAp.Key, "width", width, -1);
                SetColumnPropValue(formState, gridAp, colKey, "width", width);
            }
    
            public static void UpdateColumnHeader(this IDynamicFormView view, ControlAppearance gridAp, string colKey, string header)
            {
                IDynamicFormState formState = view.GetService<IDynamicFormState>();
                SetColumnPropValue(formState, gridAp, colKey, "header", header);
            }
    
            private static void SetFieldPropValue(IDynamicFormState formState, string key, string propName, object value, int rowIndex)
            {
                JSONObject obj2 = formState.GetControlProperty(key, -1, propName) as JSONObject;
                if (obj2 == null)
                {
                    obj2 = new JSONObject();
                }
                obj2[rowIndex.ToString()] = value;
                formState.SetControlProperty(key, rowIndex, propName, obj2);
            }
    
            private static void SetColumnPropValue(IDynamicFormState formState, ControlAppearance ctlAp, string colKey, string propName, object value)
            {
                JSONObject obj2 = new JSONObject();
                obj2["key"] = colKey;
                obj2[propName] = value;
                formState.InvokeControlMethod(ctlAp, "UpdateFieldStates", new object[] { obj2 });
            }
    
            /// <summary>
            /// 移动表格分录
            /// </summary>
            /// <param name="view"></param>
            /// <param name="entityKey"></param>
            /// <param name="iSrcRowIndex"></param>
            /// <param name="iDstRowIndex"></param>
            /// <param name="callback"></param>
            public static void MoveEntryRow(this IDynamicFormView view, string entityKey, int iSrcRowIndex, int iDstRowIndex,Action<int,int> callback=null)
            {
                EntryEntity entryEntity = view.BillBusinessInfo.GetEntryEntity(entityKey);
                DynamicObjectCollection dataEntities = view.Model.GetEntityDataObject(entryEntity);
                if (iSrcRowIndex < 0 || iSrcRowIndex >= dataEntities.Count) return;
                if (iDstRowIndex < 0 || iDstRowIndex >= dataEntities.Count) return;
                var srcRow = dataEntities[iSrcRowIndex];
                var dstRow = dataEntities[iDstRowIndex];            
                if (iSrcRowIndex > iDstRowIndex)
                {
                    dataEntities.RemoveAt(iSrcRowIndex);
                    dataEntities.Insert(iDstRowIndex, srcRow);
                }
                else
                {
                    dataEntities.RemoveAt(iDstRowIndex);
                    dataEntities.Insert(iSrcRowIndex, dstRow);
                }
    
                EntryGrid grid = view.GetControl<EntryGrid>(entityKey);
                grid.ExchangeRowIndex(iSrcRowIndex, iDstRowIndex);
                grid.SetFocusRowIndex(iDstRowIndex);
    
                if (callback != null)
                {
                    callback(iSrcRowIndex, iDstRowIndex);
                }
            }
    
            #region 实现块粘贴的填充功能
            /// <summary>
            /// 处理Excel块粘贴功能
            /// </summary>
            /// <param name="view"></param>
            /// <param name="e"></param>
            /// <param name="bAllowAutoNewRows">允许自动新增行</param>
            /// <param name="bCanPaste">是否允许填充某字段</param>
            public static void PasteBlockData(this IDynamicFormView view, EntityBlockPastingEventArgs e, bool bAllowAutoNewRows = false, Func<FieldAppearance, int, bool> bCanPaste = null)
            {
                if (e.BlockValue.IsNullOrEmptyOrWhiteSpace()) return;
                FieldAppearance startFieldAp = view.LayoutInfo.GetFieldAppearance(e.StartKey);
                if (startFieldAp == null || (startFieldAp.Field.Entity is EntryEntity) == false) return;
                EntryEntity entryEntity = (EntryEntity)startFieldAp.Field.Entity;
                int iTotalRows = view.Model.GetEntryRowCount(entryEntity.Key);
    
                var copyOperation = view.BillBusinessInfo.GetForm().FormOperations
                            .FirstOrDefault(o => o.OperationId == 31 && string.Equals(o.Parmeter.OperationObjectKey, entryEntity.Key, StringComparison.InvariantCultureIgnoreCase));
                bool isCopyLinkEntry = false;
                //如果表格未配置复制行操作,则不允许自动新增行
                if (copyOperation == null)
                {
                    bAllowAutoNewRows = false;
                }
                else
                {
                    isCopyLinkEntry = GetIsCopyLinkEntryParam(copyOperation.Parmeter);
                }
    
                string[] strBlockDataRows = e.BlockValue.Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);
                int iRow = e.StartRow;
                foreach (var rowData in strBlockDataRows)
                {
                    if (iRow >= iTotalRows)
                    {
                        if (bAllowAutoNewRows)
                        {
                            view.Model.CopyEntryRow(entryEntity.Key, iRow - 1, iRow, isCopyLinkEntry);
                        }
                        else
                        {
                            break;
                        }
                    }
                    string[] strItemValues = rowData.Split(new char[] { '\t' });
    
                    FieldAppearance fieldAp = startFieldAp;
                    foreach (var value in strItemValues)
                    {
                        if (fieldAp == null) continue;
                        object objValue = value;
    
                        if (typeof(ValueType).IsAssignableFrom(fieldAp.Field.GetPropertyType()))
                        {
                            if (value.IsNullOrEmptyOrWhiteSpace())
                            {
                                objValue = 0;
                            }
                            else
                            {
                                ValueTypeConverter converter = new ValueTypeConverter();
                                if (value != null && converter.CanConvertTo(value.GetType()))
                                {
                                    objValue = converter.ConvertTo(value, fieldAp.Field.GetPropertyType());
                                }
                            }
                        }
                        if (bCanPaste == null || bCanPaste(fieldAp, iRow))
                        {
                            (view as IDynamicFormViewService).UpdateValue(fieldAp.Key, iRow, objValue);
                        }
                        fieldAp = GetNextEditFieldAp(view, fieldAp, iRow);
                    }
    
                    iRow++;
                }
            }
    
            private static FieldAppearance GetNextEditFieldAp(IDynamicFormView view, FieldAppearance fieldAp, int iRow)
            {
                FieldAppearance nextFieldAp = null;
                if (fieldAp != null)
                {
                    EntryEntityAppearance entryEntityAp = view.LayoutInfo.GetEntryEntityAppearance(fieldAp.EntityKey);
                    if (entryEntityAp != null)
                    {
                        DynamicObject rowData = view.Model.GetEntityDataObject(entryEntityAp.Entity, iRow);
                        int iStartFindPos = entryEntityAp.Layoutinfo.Appearances.IndexOf(fieldAp);
                        if (iStartFindPos >= 0)
                        {
                            for (int i = iStartFindPos + 1; i < entryEntityAp.Layoutinfo.Appearances.Count; i++)
                            {
                                nextFieldAp = entryEntityAp.Layoutinfo.Appearances[i] as FieldAppearance;
                                if (nextFieldAp == null) continue;
                                //跳过不可见或不可编辑的字段
                                if (nextFieldAp.IsLocked(view.OpenParameter.Status) == true
                                    || nextFieldAp.IsVisible(view.OpenParameter.Status) == false) continue;
    
                                //单元格锁定也不填充
                                if (rowData != null && view.StyleManager.GetEnabled(fieldAp, rowData) == false) continue;
    
                                break;
                            }
                        }
                    }
                }
    
                return nextFieldAp;
            }
    
            private static bool GetIsCopyLinkEntryParam(OperationParameter operationParameter)
            {
                bool flag = false;
                string expressValue = operationParameter.ExpressValue;
                if (!string.IsNullOrEmpty(expressValue))
                {
                    string[] strArray = expressValue.Split(new char[] { ':' });
                    if (strArray.Length == 2)
                    {
                        flag = Convert.ToInt32(strArray[1]) == 1;
                    }
                }
                return flag;
            } 
            #endregion
            
        }
    上述代码是一个独立的类,可以放到任何工程里用,是金蝶二开中一组常用的扩展方法,设置行,单元格,菜单等元素的可见性,可用性。

    转载于:https://my.oschina.net/fanyongqiang/blog/654370

    展开全文
  • java.util.Arrays是一个与数组相关的工具类,里面提供了大量静态方法,用来实现数组常见的操作。 public static String toString(数组):将参数数组变成字符串(按照默认格式:[元素1, 元素2, 元素3…]) public ...

    java.util.Arrays是一个与数组相关的工具类,里面提供了大量静态方法,用来实现数组常见的操作。

    public static String toString(数组):将参数数组变成字符串(按照默认格式:[元素1, 元素2, 元素3…])
    public static void sort(数组):按照默认升序(从小到大)对数组的元素进行排序。

    备注:

    1. 如果是数值,sort默认按照升序从小到大
    2. 如果是字符串,sort默认按照字母升序
    3. 如果是自定义的类型,那么这个自定义的类需要有Comparable或者Comparator接口的支持。
    public class Demo01Arrays {
        public static void main(String[] args) {
            int[] array1 = {10,20,30};
            //public static String toString(数组):将参数数组变成字符串(按照默认格式:[元素1, 元素2, 元素3...])
            String str1 = Arrays.toString(array1);
            System.out.println(str1);//[10,20,30]
    
            //public static void sort(数组):按照默认升序(从小到大)对数组的元素进行排序。
            //对于数值,sort默认按照升序从小到大
            int[] array2 = {5,3,2,4,1};
            Arrays.sort(array2);
            System.out.println(Arrays.toString(array2));//[1, 2, 3, 4, 5] (或者也可以遍历一遍数组然后输出,但是这样更简洁)
    
            //对于字符串类型的数组也同样适用
            //对于字符串,sort默认按照字母升序
            String[] array3 = {"fff","ddd","bbb"};
            Arrays.sort(array3);
            System.out.println(Arrays.toString(array3));//[bbb, ddd, fff]
        }
    
    }
    
    

    题目:
    请使用Arrays相关的API,将一个随机字符串中的所有字符升序排列,并倒序打印。

    如何进行升序排列:sort
    必须是一个数组,才能用Arrays.sort方法
    String --> 数组,用toCharArray

    public class Demo02ArraysPractice {
        public static void main(String[] args) {
            String str1 = "fghjr354tyjkmnA473FFGRF";
            //将字符串转变成字符数组
            char[] chars = str1.toCharArray();
            System.out.println(chars);
    
    
            //升序排序
            Arrays.sort(chars);
    
            //倒序打印输出
            for (int i=chars.length-1;i>=0; i--) {
                System.out.print(chars[i]+" ");
            }
        }
    }
    
    展开全文
  • java.util.Math类是数学相关的工具类,里面提供了大量静态方法,完成与数学运算相关操作。 public static double abs(double num):获取绝对值。有多种重载。 public static double ceil(double num):向上取整...
  • 本文实现了JDBCUtils工具类,并总结了一些常见问题,欢迎大家参考、阅读和交流!
  • 获取两个时间间隔(秒) /** * 获取两个时间间隔(秒) * @param date1 * @param date2 * @author Hasee * @return */ public static long getDateBetween(Date date1,Date date2){ return Math.abs(...
  • 常见工具类

    2019-06-15 17:57:39
    System 包含一些有用的类字段和方法。它不能被实例化。 成员方法: public static void gc() ------- 运行垃圾回收器。 finalize()方法是一个对象在销毁时会被调用方法,垃圾收集器在发现这个对象不会再被...
  • Collections 工具类和 Arrays 工具类常见方法Collections排序操作示例查找,替换操作示例同步控制示例Arrays类的常见操作 Collections Collections 工具类常用方法: 排序 查找,替换操作 同步控制(不推荐,需要线程...
  • java.util.Arrays 针对数组进行操作的工具类,提供了查找、排序等功能。 (1) 数组转字符串toString()方法 static String toString(Object[] a) 返回指定数组内容字符串表示形式 (2) 排序方法sort()方法 底层使用...
  • 1、该类的作用是将格式为["","",""......]字符串转换为数组,或将数组转换成格式为["","",""......]字符串 import com.clfps.utils.StringUtils; import java.util.ArrayList; import java.util.List; /** ...
  • 正则表达式可以方便地对数据进行... 下面是一些常见字段校验,总结一下,以后总会用到。 1 import java.util.regex.Matcher; 2 import java.util.regex.Pattern; 3 4 public class Validate { 5 /...
  • Spring中一些工具类

    2020-06-11 22:25:54
    如果是一些常见的类,如float、int、short就直接返回对应的class,如果是某些数组,也会返回对应的类型。如果都不是,就会Class.forName创建该,第一次创建失败后,会把类名转成内部创建,如果还失败,就抛出...
  • java一些常见类和方法

    千次阅读 2018-08-02 19:05:35
    Arrays工具类常见方法: Character类常见方法: Math类常见方法: 如何获取任意范围内随机数? int number=(int)(Math.random()*(end-start))+start; System类中垃圾回收方法gc():垃圾回收器,调用...
  • 背景 在分层代码架构中,层与层之间对象避免不了要做很多转换、赋值等操作,这些操作重复且繁琐,于是乎催生出很多工具来优雅,高效地完成这个操作,...要复制对象比较简单,包含了一些基本类型;有一次warmup,
  • Java常见的开发工具

    2016-10-23 21:47:53
    JAVA的标准库虽然提供了那些最基本的数据类型操作方法,但仍然对一些常见的需求场景,缺少实用的工具类。而另一些则是JAVA标准库本身不够完善,需要第三方库去加以补充的。 1、Apache Commons Lang Apache Commons...
  • 最近在项目中需要和ftp服务器进行交互,在网上找了一下关于ftp上传下载的工具类,大致有两种。 第一种是单例模式类。 第二种是另外定义一个Service,直接通过Service来实现ftp上传下载删除。 这两种...
  • JAVA常见的加密

    2020-04-08 15:15:33
    JAVA常见的一些加密类和方法 一、工具类 1. md5加密工具类 package 加密Tester.util; import java.security.MessageDigest; public class MD5Utils { private static final String hexDigIts[] = {"0","1","2","3...
  • JDK中提供了一些工具类以供开发者使用。这样的话我们在遇到一些常见的应用场景时就可以使用这些工具类,而不用自己再重复造轮子了。 它们都在java.util.concurrent包下。先总体概括一下都有哪些工具类,它们有什么...
  • Spring中常用的工具类

    2019-06-18 10:05:18
    对Spring中一些常见的工具类进行整理备用
  • DBUtils工具类的使用

    2019-10-04 03:51:07
    DBUtils工具类1.DBUtils工具类,由apache组织提供的工具类,对JDBC做了一些简单封装。  做了查询封装,把查询结果封装到List集合 Map集合 JavaBean对象中 做了增删改封装,编写代码比较少 2.需要导入...
  • 当作为开发者的我们在设计一套复杂分布式系统之前,很多时候,我们会忘记开发配套的一些工具程序。这个工具程序可以是常见的压力测试工具。按照惯常的压力工具的使用手法,用户能够通过命令行输入执行参数来控制压测...
  • Java是世界上最强大的编程语言之一,很多...Java的标准库虽然提供了那些最基本的数据类型操作方法,但仍然对一些常见的需求场景,缺少实用的工具类。而另一些则是Java标准库本身不够完善,需要第三方库去加以补充的。
  • DatatypeConverter:在里面提供了一些静态方法,这些方法就是Decode(解码)或者Encode(编码)使用,提供一些Java中数据格式转换 简单来说就是各种常见数据类型之间相互转化,如int long string byte hex ...
  • 通信工具类

    2021-01-03 19:55:19
    JDK中提供了一些工具类以供开发者使用。这样的话我们在遇到一些常见的应用场景时就可以使用这些工具类,而不用自己再重复造轮子了。 它们都在java.util.concurrent包下。先总体概括一下都有哪些工具类,它们有什么...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 1,510
精华内容 604
关键字:

常见的一些工具类