Class ConversionTools


  • public class ConversionTools
    extends java.lang.Object
    This class provides some utility methods for converting different data types.
    Author:
    Matthias Thimm
    • Constructor Summary

      Constructors 
      Constructor Description
      ConversionTools()  
    • Method Summary

      Modifier and Type Method Description
      static java.lang.String bigInteger2BinaryString​(java.math.BigInteger value)
      Provides a string representation of the bits in the given BigInteger.
      static java.util.BitSet bigInteger2BitSet​(java.math.BigInteger value)
      Creates a bit set from the given BigInteger.
      static java.util.BitSet binaryString2BitSet​(java.lang.String s)
      Creates a bit set from the given string of zeros and ones.
      static java.lang.String bitSet2BinaryString​(java.util.BitSet s)
      Provides a string representation of the bits in the given BitSet.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ConversionTools

        public ConversionTools()
    • Method Detail

      • bigInteger2BinaryString

        public static java.lang.String bigInteger2BinaryString​(java.math.BigInteger value)
        Provides a string representation of the bits in the given BigInteger.
        Parameters:
        value - some BigInteger
        Returns:
        a string representation of the bits in the given BigInteger.
      • bigInteger2BitSet

        public static java.util.BitSet bigInteger2BitSet​(java.math.BigInteger value)
        Creates a bit set from the given BigInteger.
        Parameters:
        value - value some BigInteger
        Returns:
        a bitset representing the BigInteger.
      • bitSet2BinaryString

        public static java.lang.String bitSet2BinaryString​(java.util.BitSet s)
        Provides a string representation of the bits in the given BitSet.
        Parameters:
        s - some BitSet
        Returns:
        a string representation of the bits in the given BitSet.
      • binaryString2BitSet

        public static java.util.BitSet binaryString2BitSet​(java.lang.String s)
        Creates a bit set from the given string of zeros and ones. Additional zeros are added to the prefix in, so that the string is aligned on the right side of the bitset
        Parameters:
        s - some string of zeros and ones
        Returns:
        a bitset representing the bitvector encoded by the string.