Package org.tweetyproject.commons.util
Class ConversionTools
java.lang.Object
org.tweetyproject.commons.util.ConversionTools
This class provides some utility methods for converting different
data types.
- Author:
- Matthias Thimm
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Provides a string representation of the bits in the given BigInteger.static BitSet
bigInteger2BitSet
(BigInteger value) Creates a bit set from the given BigInteger.static BitSet
Creates a bit set from the given string of zeros and ones.static String
Provides a string representation of the bits in the given BitSet.
-
Constructor Details
-
ConversionTools
public ConversionTools()Default Constructor
-
-
Method Details
-
bigInteger2BinaryString
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
Creates a bit set from the given BigInteger.- Parameters:
value
- value some BigInteger- Returns:
- a bitset representing the BigInteger.
-
bitSet2BinaryString
-
binaryString2BitSet
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.
-