Holger's
Java API

com.antelmann.math
Class RomanNumber

java.lang.Object
  extended by java.lang.Number
      extended by com.antelmann.math.RomanNumber
All Implemented Interfaces:
Addable<RomanNumber>, Serializable, Comparable<Number>

public class RomanNumber
extends Number
implements Addable<RomanNumber>, Comparable<Number>

a representation for a roman number (internally based on an integer)

Since:
06.01.2011, 06:14:00
Author:
Holger Antelmann
See Also:
Serialized Form

Field Summary
static Converter<Integer,String> CONVERTER
           
static NumberFormat FORMAT
           
 
Constructor Summary
RomanNumber()
           
RomanNumber(int n)
           
RomanNumber(Number n)
           
RomanNumber(String n)
           
 
Method Summary
 RomanNumber add(RomanNumber other)
          adds this instance to the other given one and returns the result; this entry itself remains untouched
 int compareTo(Number o)
           
 double doubleValue()
           
 boolean equals(Object obj)
           
 float floatValue()
           
 int hashCode()
           
 int intValue()
           
 long longValue()
           
 String toString()
           
 
Methods inherited from class java.lang.Number
byteValue, shortValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CONVERTER

public static final Converter<Integer,String> CONVERTER

FORMAT

public static final NumberFormat FORMAT
Constructor Detail

RomanNumber

public RomanNumber()

RomanNumber

public RomanNumber(int n)

RomanNumber

public RomanNumber(Number n)

RomanNumber

public RomanNumber(String n)
            throws IllegalArgumentException
Throws:
IllegalArgumentException
Method Detail

add

public final RomanNumber add(RomanNumber other)
Description copied from interface: Addable
adds this instance to the other given one and returns the result; this entry itself remains untouched

Specified by:
add in interface Addable<RomanNumber>

compareTo

public final int compareTo(Number o)
Specified by:
compareTo in interface Comparable<Number>

toString

public String toString()
Overrides:
toString in class Object

intValue

public final int intValue()
Specified by:
intValue in class Number

longValue

public final long longValue()
Specified by:
longValue in class Number

floatValue

public final float floatValue()
Specified by:
floatValue in class Number

doubleValue

public final double doubleValue()
Specified by:
doubleValue in class Number

hashCode

public final int hashCode()
Overrides:
hashCode in class Object

equals

public final boolean equals(Object obj)
Overrides:
equals in class Object


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads