GJC.java
2.73 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
package com.bsth.data.zndd.voice;
import java.util.*;
public enum GJC {
CX(1, "撤销"),
QX(1, "取消"),
XZ(2, "新增"),
TJ(2, "添加"),
LJ(2, "临加"),
TZ(3, "调整"),
BC(4, "班次"),
PB(4, "排班"),
DF(5, "待发"),
SF(6, "实发"),
CC(7, "出场"),
KQ(8, "开启"),
GB(9, "关闭"),
ge(10, "一个"),
dao(11, "到"),
de(12, "的班次"),
jc(13, "进场");
private int code;
private String description;
GJC(int code, String description) {
this.code = code;
this.description = description;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public static int getNumber(String description){
int number = 999;
for (GJC gjc : GJC.values()) {
if(gjc.description.equals(description)){
number = gjc.code;
}
}
return number;
}
public static Set<String> getDescription(int number){
Set<String> description = new HashSet<>();
for (GJC gjc : GJC.values()) {
if(gjc.code==number){
description.add(gjc.description);
}
}
return description;
}
public static Set<Integer> getGJC(String yy){
Set<Integer> set=new HashSet<>();
for (GJC gjc : GJC.values()) {
char[] arr=gjc.description.toCharArray();
for (char c : arr) {
if(UploadVideoServlet.getPinyin(yy).contains(UploadVideoServlet.getPinyin(String.valueOf(c)))){
set.add(gjc.code);
}
}
}
return set;
}
public static int getCount(int i){
int count=0;
for (GJC gjc : GJC.values()) {
if(gjc.code==i){
count++;
}
}
return count;
}
public static void main(String[] args) {
List<Integer> list=new ArrayList<>();
list.add(1);
list.add(2);
list.add(4);
Set<String> ml=new HashSet<>();
nestedLoop(list,"",ml);
System.out.println(ml);
}
public static void nestedLoop(List<Integer> arr,String str,Set<String> ml) {
if(arr.size()>0){
Set<String> set=getDescription(arr.get(0));
for (String s : set) {
List list2=new ArrayList();
list2.addAll(arr);
list2.remove(0);
nestedLoop(list2,str+s,ml);
}
}else {
ml.add(str);
}
}
}