|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.util.transformers.StringTransformer
org.mmbase.util.transformers.RomanTransformer
Static utilities to deal with roman numbers, and non static functions to transform strings representing decimal numbers to roman numbers and back.
| Field Summary | |
static int |
C
Constants for roman numbers |
static int |
D
Constants for roman numbers |
static int |
I
Constants for roman numbers |
static int |
L
Constants for roman numbers |
static int |
M
Constants for roman numbers |
static Pattern |
NUMERIC
|
static Pattern |
ROMAN
|
static int |
V
Constants for roman numbers |
static int |
X
Constants for roman numbers |
| Constructor Summary | |
RomanTransformer()
|
|
| Method Summary | |
static String |
decimalToRoman(int value)
Converts int to roman number (if bigger than 0, smaller then 4000), other wise return the integer as a string. |
static char |
decimalToRomanDigit(int i)
Converts an integer to one the letters of the roman number system, or ' ' if no such number. |
static void |
main(String[] argv)
Just to test |
static int |
romanToDecimal(char r)
Converts one of the letters from the roman number system to an int. |
static int |
romanToDecimal(String roman)
Converts roman number to int. |
String |
toString()
|
String |
transform(String r)
|
String |
transformBack(String r)
|
| Methods inherited from class org.mmbase.util.transformers.StringTransformer |
transform, transform, transformBack, transformBack |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final Pattern NUMERIC
public static final Pattern ROMAN
public static final int I
public static final int V
public static final int X
public static final int L
public static final int C
public static final int D
public static final int M
| Constructor Detail |
public RomanTransformer()
| Method Detail |
public static int romanToDecimal(char r)
0 if could not be convertedpublic static char decimalToRomanDigit(int i)
decimalToRoman(int)public static int romanToDecimal(String roman)
public static String decimalToRoman(int value)
public String transform(String r)
transform in interface CharTransformertransform in class StringTransformerpublic String transformBack(String r)
transformBack in interface CharTransformertransformBack in class StringTransformerpublic String toString()
public static void main(String[] argv)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||