-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLabel.java
More file actions
56 lines (46 loc) · 1.07 KB
/
Copy pathLabel.java
File metadata and controls
56 lines (46 loc) · 1.07 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
class Label {
protected String label;
private static HashTable labelhash;
Integer last;
int next;
public Label() {
if (labelhash == null) {
labelhash = new HashTable(199);
}
last = (Integer) labelhash.find("LABEL");
if (last == null) {
next = 1;
labelhash.insert("LABEL", new Integer(1));
label = "LABEL1";
} else {
next = last.intValue() + 1;
labelhash.delete("LABEL");
labelhash.insert("LABEL", new Integer(next));
label = "LABEL" + next;
}
}
public Label(String s) {
if (labelhash == null) {
labelhash = new HashTable(199);
}
last = (Integer) labelhash.find(s);
if (last == null) {
next = 1;
labelhash.insert(s, new Integer(1));
label = s + 1;
} else {
next = last.intValue() + 1;
labelhash.delete(s);
labelhash.insert(s, new Integer(next));
label = s + next;
}
}
public static Label AbsLabel(String s) {
Label abslab = new Label();
abslab.label = s;
return abslab;
}
public String toString() {
return label;
}
}