org.openmuc.jmbus
Class BCD

java.lang.Object
  extended by java.lang.Number
      extended by org.openmuc.jmbus.BCD
All Implemented Interfaces:
java.io.Serializable

public class BCD
extends java.lang.Number

Encodes and decodes BCD encoded numbers. This class subclasses the java.lang.Number class. Therefore it can be used to convert BCD numbers to other Number subclasses in the java.lang package.

See Also:
Serialized Form

Constructor Summary
BCD(byte[] bcd)
           
BCD(int integer)
           
BCD(java.lang.String str)
           
 
Method Summary
 double doubleValue()
           
 float floatValue()
           
 byte[] getByteString()
           
 int getDigits()
           
 int intValue()
           
 long longValue()
           
 int toInteger()
           
 long toLong()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Number
byteValue, shortValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BCD

public BCD(java.lang.String str)

BCD

public BCD(int integer)

BCD

public BCD(byte[] bcd)
Method Detail

getByteString

public byte[] getByteString()

toString

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

getDigits

public int getDigits()

toInteger

public int toInteger()
              throws OutOfRangeException
Throws:
OutOfRangeException

toLong

public long toLong()
            throws OutOfRangeException
Throws:
OutOfRangeException

doubleValue

public double doubleValue()
Specified by:
doubleValue in class java.lang.Number

floatValue

public float floatValue()
Specified by:
floatValue in class java.lang.Number

intValue

public int intValue()
Specified by:
intValue in class java.lang.Number

longValue

public long longValue()
Specified by:
longValue in class java.lang.Number