01: package org.swingml.treetablebrowser.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: String pattern = null;
13:
14: public NumberConverter() {
15: }
16:
17: public NumberConverter(String p) {
18: setPattern(p);
19: }
20:
21: public int compare(String value1, String value2) {
22: Double dec1 = new Double(value1);
23: Double dec2 = new Double(value2);
24: return dec1.compareTo(dec2);
25: }
26:
27: /**
28: * Returns the pattern.
29: * @return String
30: */
31: public String getPattern() {
32: return pattern;
33: }
34:
35: /**
36: * Sets the pattern.
37: * @param pattern The pattern to set
38: */
39: public void setPattern(String pattern) {
40: this.pattern = pattern;
41: }
42: }
|