01: package org.swingml.tablebrowser.ext;
02:
03: /**
04: * @author dpitt
05: *
06: * To change this generated comment edit the template variable "typecomment":
07: * Window>Preferences>Java>Templates.
08: * To enable and disable the creation of type comments go to
09: * Window>Preferences>Java>Code Generation.
10: */
11: public class NumberConverter {
12:
13: String pattern = null;
14:
15: public NumberConverter() {
16: }
17:
18: public NumberConverter(String p) {
19:
20: setPattern(p);
21: }
22:
23: public int compare(String value1, String value2) {
24:
25: Double dec1 = new Double(value1);
26: Double dec2 = new Double(value2);
27:
28: return dec1.compareTo(dec2);
29:
30: }
31:
32: /**
33: * Returns the pattern.
34: * @return String
35: */
36: public String getPattern() {
37: return pattern;
38: }
39:
40: /**
41: * Sets the pattern.
42: * @param pattern The pattern to set
43: */
44: public void setPattern(String pattern) {
45: this.pattern = pattern;
46: }
47:
48: }
|