Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mmm-rain
AndroidUtilCode
提交
2f5d779d
A
AndroidUtilCode
项目概览
mmm-rain
/
AndroidUtilCode
与 Fork 源项目一致
从无法访问的项目Fork
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
AndroidUtilCode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2f5d779d
编写于
8月 15, 2019
作者:
B
Blankj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
see 08/15 log
上级
8a6976d3
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
19 addition
and
14 deletion
+19
-14
README-CN.md
README-CN.md
+1
-1
lib/utilcode/README-CN.md
lib/utilcode/README-CN.md
+1
-1
lib/utilcode/src/main/java/com/blankj/utilcode/util/ArrayUtils.java
...de/src/main/java/com/blankj/utilcode/util/ArrayUtils.java
+9
-9
lib/utilcode/src/main/java/com/blankj/utilcode/util/MapUtils.java
...code/src/main/java/com/blankj/utilcode/util/MapUtils.java
+4
-2
lib/utilcode/src/test/java/com/blankj/utilcode/util/ArrayUtilsTest.java
...rc/test/java/com/blankj/utilcode/util/ArrayUtilsTest.java
+4
-1
未找到文件。
README-CN.md
浏览文件 @
2f5d779d
...
...
@@ -42,7 +42,7 @@
## 打个小广告
欢迎加入我的知识星球「
**[基你太美](https://t.zsxq.com/FmeqfYF)**
」
学习
[
AucFrame
](
https://blankj.com/2019/07/22/auc-frame/
)
框架,目前一期内测已结束,二期已开,有兴趣进群的可以加我微信(备注:基你太美二期)。
欢迎加入我的知识星球「
**[基你太美](https://t.zsxq.com/FmeqfYF)**
」
,我会在星球中分享
[
AucFrame
](
https://blankj.com/2019/07/22/auc-frame/
)
框架、大厂面经、
[
AndroidUtilCode
](
https://github.com/Blankj/AndroidUtilCode
)
更详尽的说明...一切我所了解的知识,你可以通过支付进入我的星球「
**[基你太美](https://t.zsxq.com/FmeqfYF)**
」进行体验,加入后优先观看星球中精华的部分,如果觉得星球的内容对自身没有收益,你可以自行申请退款退出星球,也没必要加我好友;
**如果你已确定要留在我的星球,可以通过扫描如下二维码(备注:基你太美)加我个人微信,向我发送你的星球 ID,方便我后续拉你进群(PS:进得越早价格越便宜)。**
![
我的二维码
](
https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/wechat.png
)
...
...
lib/utilcode/README-CN.md
浏览文件 @
2f5d779d
...
...
@@ -628,7 +628,7 @@ isEmpty : 判断 Map 是否为空
isNotEmpty : 判断 Map 是否非空
size : 获取 Map 元素个数
forAllDo : 对所有元素做操作
transform : 对
集合
做转变
transform : 对
Map
做转变
toString : Map 转为字符串
```
...
...
lib/utilcode/src/main/java/com/blankj/utilcode/util/ArrayUtils.java
浏览文件 @
2f5d779d
...
...
@@ -32,39 +32,39 @@ public class ArrayUtils {
*/
@SafeVarargs
public
static
<
T
>
T
[]
newArray
(
T
...
array
)
{
return
copy
(
array
)
;
return
array
;
}
public
static
long
[]
newLongArray
(
long
...
array
)
{
return
copy
(
array
)
;
return
array
;
}
public
static
int
[]
newIntArray
(
int
...
array
)
{
return
copy
(
array
)
;
return
array
;
}
public
static
short
[]
newShortArray
(
short
...
array
)
{
return
copy
(
array
)
;
return
array
;
}
public
static
char
[]
newCharArray
(
char
...
array
)
{
return
copy
(
array
)
;
return
array
;
}
public
static
byte
[]
newByteArray
(
byte
...
array
)
{
return
copy
(
array
)
;
return
array
;
}
public
static
double
[]
newDoubleArray
(
double
...
array
)
{
return
copy
(
array
)
;
return
array
;
}
public
static
float
[]
newFloatArray
(
float
...
array
)
{
return
copy
(
array
)
;
return
array
;
}
public
static
boolean
[]
newBooleanArray
(
boolean
...
array
)
{
return
copy
(
array
)
;
return
array
;
}
/**
...
...
lib/utilcode/src/main/java/com/blankj/utilcode/util/MapUtils.java
浏览文件 @
2f5d779d
package
com.blankj.utilcode.util
;
import
android.support.annotation.NonNull
;
import
android.util.Pair
;
import
java.util.Collections
;
...
...
@@ -64,8 +63,11 @@ public class MapUtils {
}
@SafeVarargs
public
static
<
K
,
V
>
TreeMap
<
K
,
V
>
newTreeMap
(
@NonNull
final
Comparator
<
K
>
comparator
,
public
static
<
K
,
V
>
TreeMap
<
K
,
V
>
newTreeMap
(
final
Comparator
<
K
>
comparator
,
final
Pair
<
K
,
V
>...
pairs
)
{
if
(
comparator
==
null
)
{
throw
new
IllegalArgumentException
(
"comparator must not be null"
);
}
TreeMap
<
K
,
V
>
map
=
new
TreeMap
<>(
comparator
);
if
(
pairs
==
null
||
pairs
.
length
==
0
)
{
return
map
;
...
...
lib/utilcode/src/test/java/com/blankj/utilcode/util/ArrayUtilsTest.java
浏览文件 @
2f5d779d
...
...
@@ -53,7 +53,6 @@ public class ArrayUtilsTest extends BaseTest {
Object
emptyArr1
=
new
int
[]{};
Assert
.
assertTrue
(
ArrayUtils
.
isSameLength
(
null
,
emptyArr1
));
Assert
.
assertTrue
(
ArrayUtils
.
isSameLength
(
new
boolean
[
0
],
emptyArr1
));
}
@Test
...
...
@@ -188,6 +187,10 @@ public class ArrayUtilsTest extends BaseTest {
List
<
Integer
>
list
=
ArrayUtils
.
asList
(
1
,
2
,
3
,
4
);
System
.
out
.
println
(
list
);
List
<
Integer
>
list1
=
ArrayUtils
.
asUnmodifiableList
(
1
,
2
,
3
,
4
);
list1
.
set
(
0
,
2
);
System
.
out
.
println
(
list1
);
}
@Test
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录