ParamInfoGroup.java
2.56 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
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.xmp.schema.rng.model;
import com.adobe.xmp.schema.rng.model.ParamInfo;
import java.util.Stack;
/*
* This class specifies class file version 49.0 but uses Java 6 signatures. Assumed Java 6.
*/
public class ParamInfoGroup
implements ParamInfo {
private Stack<ParamInfo> mParamInfos;
private final Operator mOperator;
private boolean isChoice;
public ParamInfoGroup(Operator operator) {
this.mOperator = operator;
this.mParamInfos = new Stack();
}
public Operator getOperator() {
return this.mOperator;
}
public void push(ParamInfo info) {
ParamInfoGroup group;
boolean exists = false;
ParamInfo newInfo = info;
if (info instanceof ParamInfoGroup && (group = (ParamInfoGroup)info).size() == 1) {
newInfo = group.pop();
}
for (ParamInfo param : this.mParamInfos) {
exists |= param.equals(newInfo);
}
if (!exists) {
this.mParamInfos.push(newInfo);
}
}
ParamInfo pop() {
return this.mParamInfos.pop();
}
public boolean empty() {
return this.mParamInfos.empty();
}
int size() {
return this.mParamInfos.size();
}
public Stack<ParamInfo> getParams() {
return this.mParamInfos;
}
@Override
public boolean equals(ParamInfo param) {
boolean ret = false;
if (param instanceof ParamInfoGroup) {
ParamInfoGroup group = (ParamInfoGroup)param;
if (this.size() == group.size()) {
for (int i = 0; i < this.size(); ++i) {
ret |= this.mParamInfos.get(i).equals(group.mParamInfos.get(i));
}
}
}
return ret;
}
public void setChoice(boolean isChoice) {
this.isChoice = isChoice;
}
public boolean isChoice() {
return this.isChoice;
}
public String toString() {
StringBuilder str = new StringBuilder();
str.append("========== ParamInfoGroup =========");
str.append("\nOperator : ").append((Object)this.mOperator);
if (this.mParamInfos != null) {
for (ParamInfo param : this.mParamInfos) {
str.append(param.toString());
}
}
return str.toString();
}
/*
* This class specifies class file version 49.0 but uses Java 6 signatures. Assumed Java 6.
*/
public static enum Operator {
kOR,
kAND;
private Operator() {
}
}
}