1
2
3
4
5
6
7
8 package com.buckosoft.PicMan.domain;
9
10 import java.text.DecimalFormat;
11
12
13
14
15 public class SetSize {
16 private String setName;
17 private int size;
18
19 private static final DecimalFormat df3 = new DecimalFormat("000");
20
21
22 public SetSize() {}
23
24
25
26
27 public SetSize(String setSizeName) {
28 setSetSize(setSizeName);
29 }
30
31
32
33
34
35 public SetSize(String setName, int size) {
36 this.setName = setName;
37 this.size = size;
38 }
39
40 public String getGuiSetSize() {
41 return(new String(getSetName()
42 + "_" + df3.format(getSize())));
43 }
44 public String getSetSizeDash() {
45 return(new String(getSetName()
46 + "-" + df3.format(getSize())));
47 }
48 public void setSetSize(String setSize) {
49 int i = setSize.indexOf('_');
50 if (i != -1) {
51 setSetName(setSize.substring(0,i));
52 setSize(Integer.parseInt(setSize.substring(i+1,setSize.length())));
53 return;
54 }
55 i = setSize.indexOf('-');
56 if (i != -1) {
57 setSetName(setSize.substring(0,i));
58 setSize(Integer.parseInt(setSize.substring(i+1,setSize.length())));
59 return;
60 }
61
62 setSetName(setSize);
63 setSize(0);
64 }
65
66 public String getSetSize() {
67 return(setName + "_" + size);
68 }
69
70 public String getSetName() {
71 return setName;
72 }
73 public void setSetName(String set) {
74 this.setName = set;
75 }
76 public int getSize() {
77 return size;
78 }
79 public void setSize(int size) {
80 this.size = size;
81 }
82 }