svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.expressionevaluator / org.gvsig.expressionevaluator.lib / org.gvsig.expressionevaluator.lib.impl / src / main / java / org / gvsig / expressionevaluator / impl / repr / ReprNumber.java @ 44644
History | View | Annotate | Download (857 Bytes)
1 |
package org.gvsig.expressionevaluator.impl.repr; |
---|---|
2 |
|
3 |
import org.gvsig.expressionevaluator.ReprMethod; |
4 |
import org.gvsig.expressionevaluator.ExpressionEvaluatorLocator; |
5 |
import org.gvsig.expressionevaluator.ExpressionEvaluatorManager; |
6 |
|
7 |
|
8 |
/**
|
9 |
*
|
10 |
* @author jjdelcerro
|
11 |
*/
|
12 |
public class ReprNumber implements ReprMethod { |
13 |
|
14 |
public ReprNumber() {
|
15 |
} |
16 |
|
17 |
@Override
|
18 |
public String getName() { |
19 |
return this.getClass().getSimpleName(); |
20 |
} |
21 |
|
22 |
@Override
|
23 |
public boolean isApplicable(Object value) { |
24 |
return value instanceof Number; |
25 |
} |
26 |
|
27 |
@Override
|
28 |
public String repr(Object value) { |
29 |
return ((Number)value).toString(); |
30 |
} |
31 |
|
32 |
public static void selfRegister() { |
33 |
ExpressionEvaluatorManager manager = ExpressionEvaluatorLocator.getManager(); |
34 |
manager.addReprMethod(new ReprNumber());
|
35 |
} |
36 |
|
37 |
} |