All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.docx4j.model.listnumbering.NumberFormatRomanUpper Maven / Gradle / Ivy

Go to download

docx4j is a library which helps you to work with the Office Open XML file format as used in docx documents, pptx presentations, and xlsx spreadsheets.

There is a newer version: 11.4.11
Show newest version
package org.docx4j.model.listnumbering;

//File   : gui/componenents/calculators/Roman.java
//Description: A static method for converting binary integers to Roman numbers.
//Illustrates: Static inner value class, StringBuffer, throw exceptions.
//Author : Fred Swartz - 2006-12-29 - Placed in public domain

//JH comment - under the MIT license, according to the footer at
// http://leepoint.net/notes-java/examples/components/romanNumerals/romanNumeral.html

/////////////////////////////////////////////////////////////////// class Roman
public class NumberFormatRomanUpper extends NumberFormatRomanAbstract {
	
	
	NumberFormatRomanUpper() {
		
		ROMAN_VALUE_TABLE = ROMAN_VALUE_TABLE_UPPER;
	}
	
	
 //================================================================ constant
 // This could be alternatively be done with parallel arrays.
 // Another alternative would be Pair
 static RomanValue[] ROMAN_VALUE_TABLE_UPPER = {	 
     new RomanValue(1000, "M"),
     new RomanValue( 900, "CM"),
     new RomanValue( 500, "D"),
     new RomanValue( 400, "CD"),
     new RomanValue( 100, "C"),
     new RomanValue(  90, "XC"),
     new RomanValue(  50, "L"),
     new RomanValue(  40, "XL"),
     new RomanValue(  10, "X"),
     new RomanValue(   9, "IX"),
     new RomanValue(   5, "V"),
     new RomanValue(   4, "IV"),
     new RomanValue(   1, "I")
 };
 
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy