com.adobe.icc.ddg
Class RomanNumeral

java.lang.Object
  extended by com.adobe.icc.ddg.RomanNumeral

public class RomanNumeral
extends java.lang.Object

An object of type RomanNumeral is an integer between 1 and 3999. It can be constructed either from an integer or from a string that represents a Roman numeral in this range.

The function toString() will return a standardized Roman numeral (upper case) representation of the number.

The function toInt() will return the number as a value of type int.

TODO: Validation around the roman characters and numbers. For now, since this is used internally only, we can safely assume that there would be no invalid cases.


Constructor Summary
RomanNumeral(int arabic)
           
RomanNumeral(java.lang.String roman)
           
 
Method Summary
 void increment(int value)
          Increment the current roman number's value by the given value.
 int toInt()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RomanNumeral

public RomanNumeral(int arabic)

RomanNumeral

public RomanNumeral(java.lang.String roman)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toInt

public int toInt()

increment

public void increment(int value)
Increment the current roman number's value by the given value.

Parameters:
value - the value by which the current number needs to be incremented


[an error occurred while processing this directive] [an error occurred while processing this directive]