- 浏览: 132064 次
- 性别:
- 来自: 重庆
文章分类
最新评论
-
酱油男js:
不错...学习了。
oracle sql 优化大全 -
浪子秋水:
网页编码就是那点事 -
shenghuorulan:
通俗易懂。好文章,直接想到的问题都提到了。
oracle 全文检索实践 -
飞儿9530:
lucene 3.0.1 学习
// 1.打印数组
ArrayUtils.toString(newint[] { 1, 4, 2, 3 });// {1,4,2,3}
ArrayUtils.toString(new Integer[] { 1, 4, 2, 3 });// {1,4,2,3}
ArrayUtils.toString(null, "I'm nothing!");// I'm nothing!
// 2.判断两个数组是否相等,采用EqualsBuilder进行判断
// 只有当两个数组的数据类型,长度,数值顺序都相同的时候,该方法才会返回True
// 2.1 两个数组完全相同
ArrayUtils.isEquals(newint[] { 1, 2, 3 }, newint[] { 1, 2, 3 });// true
// 2.2 数据类型以及长度相同,但各个Index上的数据不是一一对应
ArrayUtils.isEquals(newint[] { 1, 3, 2 }, newint[] { 1, 2, 3 });//true
// 2.3 数组的长度不一致
ArrayUtils.isEquals(newint[] { 1, 2, 3, 3 }, newint[] { 1, 2, 3 });//false
// 2.4 不同的数据类型
ArrayUtils.isEquals(newint[] { 1, 2, 3 }, newlong[] { 1, 2, 3 });// false
ArrayUtils.isEquals(new Object[] { 1, 2, 3 }, new Object[] { 1, (long) 2, 3 });// false
// 2.5 Null处理,如果输入的两个数组都为null时候则返回true
ArrayUtils.isEquals(newint[] { 1, 2, 3 }, null);// false
ArrayUtils.isEquals(null, null);// true
// 3.将一个数组转换成Map
// 如果数组里是Entry则其Key与Value就是新Map的Key和Value,如果是Object[]则Object[0]为KeyObject[1]为Value
// 对于Object[]数组里的元素必须是instanceof Object[]或者Entry,即不支持基本数据类型数组
// 如:ArrayUtils.toMap(new Object[]{new int[]{1,2},new int[]{3,4}})会出异常
ArrayUtils.toMap(new Object[] { new Object[] { 1, 2 }, new Object[] { 3, 4 } });// {1=2,
// 3=4}
ArrayUtils.toMap(new Integer[][] { new Integer[] { 1, 2 }, new Integer[] { 3, 4 } });// {1=2,
// 3=4}
// 4.拷贝数组
ArrayUtils.clone(newint[] { 3, 2, 4 });// {3,2,4}
// 5.截取数组
ArrayUtils.subarray(newint[] { 3, 4, 1, 5, 6 }, 2, 4);// {1,5}
// 起始index为2(即第三个数据)结束index为4的数组
ArrayUtils.subarray(newint[] { 3, 4, 1, 5, 6 }, 2, 10);// {1,5,6}
// 如果endIndex大于数组的长度,则取beginIndex之后的所有数据
// 6.判断两个数组的长度是否相等
ArrayUtils.isSameLength(new Integer[] { 1, 3, 5 }, new Long[] { 2L, 8L, 10L });// true
// 7.获得数组的长度
ArrayUtils.getLength(newlong[] { 1, 23, 3 });// 3
// 8.判段两个数组的类型是否相同
ArrayUtils.isSameType(newlong[] { 1, 3 }, newlong[] { 8, 5, 6 });// true
ArrayUtils.isSameType(newint[] { 1, 3 }, newlong[] { 8, 5, 6 });// false
// 9.数组反转
int[] array =newint[] { 1, 2, 5 };
ArrayUtils.reverse(array);// {5,2,1}
// 10.查询某个Object在数组中的位置,可以指定起始搜索位置,找不到返回-1
// 10.1 从正序开始搜索,搜到就返回当前的index否则返回-1
ArrayUtils.indexOf(newint[] { 1, 3, 6 }, 6);// 2
ArrayUtils.indexOf(newint[] { 1, 3, 6 }, 2);// -1
// 10.2 从逆序开始搜索,搜到就返回当前的index否则返回-1
ArrayUtils.lastIndexOf(newint[] { 1, 3, 6 }, 6);// 2
// 11.查询某个Object是否在数组中
ArrayUtils.contains(newint[] { 3, 1, 2 }, 1);// true
// 对于Object数据是调用该Object.equals方法进行判断
ArrayUtils.contains(new Object[] { 3, 1, 2 }, 1L);// false
// 12.基本数据类型数组与外包型数据类型数组互转
ArrayUtils.toObject(newint[] { 1, 2 });// new Integer[]{Integer,Integer}
ArrayUtils.toPrimitive(new Integer[] { new Integer(1), new Integer(2) });// new int[]{1,2}
// 13.判断数组是否为空(null和length=0的时候都为空)
ArrayUtils.isEmpty(newint[0]);// true
ArrayUtils.isEmpty(new Object[] { null });// false
// 14.合并两个数组
ArrayUtils.addAll(newint[] { 1, 3, 5 }, newint[] { 2, 4 });// {1,3,5,2,4}
// 15.添加一个数据到数组
ArrayUtils.add(newint[] { 1, 3, 5 }, 4);// {1,3,5,4}
// 16.删除数组中某个位置上的数据
ArrayUtils.remove(newint[] { 1, 3, 5 }, 1);// {1,5}
// 17.删除数组中某个对象(从正序开始搜索,删除第一个)
ArrayUtils.removeElement(newint[] { 1, 3, 5 }, 3);// {1,5}
ArrayUtils.toString(newint[] { 1, 4, 2, 3 });// {1,4,2,3}
ArrayUtils.toString(new Integer[] { 1, 4, 2, 3 });// {1,4,2,3}
ArrayUtils.toString(null, "I'm nothing!");// I'm nothing!
// 2.判断两个数组是否相等,采用EqualsBuilder进行判断
// 只有当两个数组的数据类型,长度,数值顺序都相同的时候,该方法才会返回True
// 2.1 两个数组完全相同
ArrayUtils.isEquals(newint[] { 1, 2, 3 }, newint[] { 1, 2, 3 });// true
// 2.2 数据类型以及长度相同,但各个Index上的数据不是一一对应
ArrayUtils.isEquals(newint[] { 1, 3, 2 }, newint[] { 1, 2, 3 });//true
// 2.3 数组的长度不一致
ArrayUtils.isEquals(newint[] { 1, 2, 3, 3 }, newint[] { 1, 2, 3 });//false
// 2.4 不同的数据类型
ArrayUtils.isEquals(newint[] { 1, 2, 3 }, newlong[] { 1, 2, 3 });// false
ArrayUtils.isEquals(new Object[] { 1, 2, 3 }, new Object[] { 1, (long) 2, 3 });// false
// 2.5 Null处理,如果输入的两个数组都为null时候则返回true
ArrayUtils.isEquals(newint[] { 1, 2, 3 }, null);// false
ArrayUtils.isEquals(null, null);// true
// 3.将一个数组转换成Map
// 如果数组里是Entry则其Key与Value就是新Map的Key和Value,如果是Object[]则Object[0]为KeyObject[1]为Value
// 对于Object[]数组里的元素必须是instanceof Object[]或者Entry,即不支持基本数据类型数组
// 如:ArrayUtils.toMap(new Object[]{new int[]{1,2},new int[]{3,4}})会出异常
ArrayUtils.toMap(new Object[] { new Object[] { 1, 2 }, new Object[] { 3, 4 } });// {1=2,
// 3=4}
ArrayUtils.toMap(new Integer[][] { new Integer[] { 1, 2 }, new Integer[] { 3, 4 } });// {1=2,
// 3=4}
// 4.拷贝数组
ArrayUtils.clone(newint[] { 3, 2, 4 });// {3,2,4}
// 5.截取数组
ArrayUtils.subarray(newint[] { 3, 4, 1, 5, 6 }, 2, 4);// {1,5}
// 起始index为2(即第三个数据)结束index为4的数组
ArrayUtils.subarray(newint[] { 3, 4, 1, 5, 6 }, 2, 10);// {1,5,6}
// 如果endIndex大于数组的长度,则取beginIndex之后的所有数据
// 6.判断两个数组的长度是否相等
ArrayUtils.isSameLength(new Integer[] { 1, 3, 5 }, new Long[] { 2L, 8L, 10L });// true
// 7.获得数组的长度
ArrayUtils.getLength(newlong[] { 1, 23, 3 });// 3
// 8.判段两个数组的类型是否相同
ArrayUtils.isSameType(newlong[] { 1, 3 }, newlong[] { 8, 5, 6 });// true
ArrayUtils.isSameType(newint[] { 1, 3 }, newlong[] { 8, 5, 6 });// false
// 9.数组反转
int[] array =newint[] { 1, 2, 5 };
ArrayUtils.reverse(array);// {5,2,1}
// 10.查询某个Object在数组中的位置,可以指定起始搜索位置,找不到返回-1
// 10.1 从正序开始搜索,搜到就返回当前的index否则返回-1
ArrayUtils.indexOf(newint[] { 1, 3, 6 }, 6);// 2
ArrayUtils.indexOf(newint[] { 1, 3, 6 }, 2);// -1
// 10.2 从逆序开始搜索,搜到就返回当前的index否则返回-1
ArrayUtils.lastIndexOf(newint[] { 1, 3, 6 }, 6);// 2
// 11.查询某个Object是否在数组中
ArrayUtils.contains(newint[] { 3, 1, 2 }, 1);// true
// 对于Object数据是调用该Object.equals方法进行判断
ArrayUtils.contains(new Object[] { 3, 1, 2 }, 1L);// false
// 12.基本数据类型数组与外包型数据类型数组互转
ArrayUtils.toObject(newint[] { 1, 2 });// new Integer[]{Integer,Integer}
ArrayUtils.toPrimitive(new Integer[] { new Integer(1), new Integer(2) });// new int[]{1,2}
// 13.判断数组是否为空(null和length=0的时候都为空)
ArrayUtils.isEmpty(newint[0]);// true
ArrayUtils.isEmpty(new Object[] { null });// false
// 14.合并两个数组
ArrayUtils.addAll(newint[] { 1, 3, 5 }, newint[] { 2, 4 });// {1,3,5,2,4}
// 15.添加一个数据到数组
ArrayUtils.add(newint[] { 1, 3, 5 }, 4);// {1,3,5,4}
// 16.删除数组中某个位置上的数据
ArrayUtils.remove(newint[] { 1, 3, 5 }, 1);// {1,5}
// 17.删除数组中某个对象(从正序开始搜索,删除第一个)
ArrayUtils.removeElement(newint[] { 1, 3, 5 }, 3);// {1,5}
发表评论
-
linux重启oracle 各种方法
2013-01-15 09:53 1269来自 : http://blog.sina.com.cn/s/ ... -
SVN服务器配置
2013-01-10 22:49 1208来自:http://air-blue55.blog.163.c ... -
网页编码就是那点事
2012-11-24 16:10 928来自 : http://www.kuqin.com/webpa ... -
Tomcat 配置 CAS 的一个问题。unable to find valid certification path to requested target
2012-11-11 21:40 1519来自: http://blog.csdn.net/cool_ ... -
Tomcat SSL配置大全
2012-11-11 21:02 1202来源: http://www.iteye.com/topi ... -
Html中td自动换行问题
2012-10-25 17:57 1003来自:http://blog.csdn.net/dududu0 ... -
oracle 全角、半角转换,和oracle 的 DUMP函数
2012-06-18 09:56 2067to_single_byte(c)转换成半角 to_multi ... -
tomcat sso 配置
2012-05-29 23:18 1625源: http://www.oecp.cn/hi/single ... -
Hibernate 利用配置文件配置HQL/SQL
2012-05-21 17:14 1794Query.hbm.xml <?xml version= ... -
CAS工作流程
2012-05-19 22:25 1568CAS3.0的工作流程: 0.app将用户转发到CAS处, 并 ... -
jforum 表目录
2012-04-18 18:37 2927目 录 1、附件关系表JFORUM_ATTACH 2 2、附件 ... -
Jfroum集成cas单点登录
2012-04-17 21:35 15031.安装CAS 下载cas server ,设置好服务器端, ... -
JForum登录用例
2012-04-15 22:59 60541,键入用户名、密码,单击“登入”按钮,登录请求发送到/JFo ... -
tinyMCE 详细文档
2012-03-28 10:57 2116http://www.iwms.net/n2065c17.as ... -
JBPM3.1.4 相关表的 意义
2012-03-18 22:54 994JBPM_ACTION action记录表 JBPM_DEC ... -
JBPM环境配置
2012-03-18 18:56 1811jBPM 需要数据库支持, j ... -
xfire 编写webservice例子
2012-02-23 16:51 1047来自 : http://www.blogjava.net/j ... -
Tomcat自动缓存context.xml,导致在eclipse中修改后,不能立即启作用
2012-02-18 11:56 1763http://blog.csdn.net/shiqidide/ ... -
JavaScript CSS Style属性对照表
2012-02-11 22:36 1086CSS语法 (不区分大小写) JavaScript语法 (区分 ... -
JQUERY TREE
2012-01-09 14:49 1182要使用jquery.treeview.js,当然第一步是要把它 ...
相关推荐
commons.lang ArrayUtils类的中文api 主要扩展了对java.lang包下对数组的操作!
ArrayUtils等6个文件.zip
Java字符串加密使用到的一个jar包 commons-lang3-3.1.jar下载 jar包含具体的类有 org.apache.commons.lang3.StringUtils org.apache.commons.lang3.ArrayUtils.class org.apache.commons.lang3.BitField.class org....
java 工具类 lang3 jar包 StringUtils ArrayUtils SystemUtils
ArrayUtils 数组工具类,提供一些有关数组的便捷方法 ByteUtils 字节工具类,提供一些有关字节的便捷方法 CheckAdapter 选择适配器 CheckingUtils 提供常用数据验证的工具类,不符合的话就抛异常 Countdown 倒计时器...
ArrayUtils arrut.isEmpty var array = [ "a" , "b" , "c" ] ; var empty = arrut . isEmpty ( array ) ; // false 阿鲁特克隆 var array = [ "a" , "b" , "c" ] ; var clone = arrut . clone ( array ) ; // [...
主要介绍总结的Android开发中常用的工具类,大部分同样适用于Java。 目前包括HttpUtils、DownloadManagerPro、ShellUtils、PackageUtils、 PreferencesUtils、JSONUtils、FileUtils、ResourceUtils、StringUtils、 ...
包含以上三个方法,默认使用gzip压缩,使用bufferedReader提高读取速度。 HttpRequest中可以设置url、timeout、userAgent等其他http参数 HttpResponse中可以获取返回内容、http响应码、http过期时间(Cache-Control的...
java.util.Collection及其子类,加上java.util.Collections类提供的操作方法,处理一些简单的数据结构问题还可以,稍微复杂一点的就觉得 有点头痛,很多细节的地方需要我插入这样那样的小逻辑,或者感觉它太死板,...
commons-lang3-3.2.1.jar下载,可用于ArrayUtils等工具使用
apache commons jar(commons所有的jar包,从官网下载提供给大家) 因为涉及jar太多,包括有源代码,需要的请自取。
主要介绍总结的Android开发中常用的工具类,大部分同样适用于Java。 目前包括HttpUtils、DownloadManagerPro、ShellUtils、PackageUtils、PreferencesUtils、JSONUtils、FileUtils、ResourceUtils、StringUtils、...
目前包括HttpUtils、DownloadManagerPro、ShellUtils、PackageUtils、PreferencesUtils、JSONUtils、FileUtils、ResourceUtils、StringUtils、ParcelUtils、RandomUtils、ArrayUtils、ImageUtils、ListUtils、...
在项目中使用 import "cryptofin-solidity/contracts/array-utils/AddressArrayUtils.sol"; contract Contract { using AddressArrayUtils for address[]; function containsDeadBeef(address[] memory addresses)...
Apache Commons Lang资源包,下载解压缩后,可获得api文档,源码,jar包,用于开发
一个简单的开源Android工具类库,提供许多常用的类帮助我们开发程序。 These are the Android Common Utils. Class Introduction AnimationUtils Animation Unility Class AppUtils App Unility Class ...
var arrayUtils = require ( 'picu' ) . array ; 之间 在每个单元格之间插入一个新值 var a = [ 1 , 2 , 3 ] ; var b = arrayUtils . inbetween ( a , 'x' ) ; // b -> [1, 'x', 2, 'x', 3] .shuffle 随机排列...
java常用帮助类 很多逻辑写过,为了减少重复性工作,将平时经常用到的一些方法封装成工具类 基本包下: ArrayUtils分布式操作工具类 MapSortUtils map排序工具类 CollectionUtils集合操作 DocumentUtils文档操作 ...
必须使用的jar包。为JRE5.0+的更好的版本所提供 Jar文件包含的类: META-INF/MANIFEST.MFMETA-INF/LICENSE.txtMETA-INF/NOTICE.txtorg.apache.commons.lang.ArrayUtils.class org.apache.commons.lang.BitField....