-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.java
More file actions
37 lines (33 loc) · 988 Bytes
/
Test.java
File metadata and controls
37 lines (33 loc) · 988 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package zidingyi;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.function.BiFunction;
/**
* @author : 张勇杰
* @date : 2019/10/14 17:52
* @Version : v1.0
* @description
**/
public class Test {
public static void main(String[] args) {
String s = "aaaaaaaaaaaaa";
List<Operate<String>> operates = new ArrayList<>();
Operate<String> lenthO = new LengthOperate();
Operate<String> judgeO = new JudgeStartOperate();
operates.add(lenthO);
operates.add(judgeO);
doSomething(s,operates);
Comparator<Integer> comparator = Integer::compare;
System.out.println(comparator.compare(1,2));
}
public static String doSomething(String s, List<Operate<String>> operates){
String re = "";
for(Operate o :operates){
if((re = (String) o.operate(s)).equals("")){
break;
}
}
return re;
}
}