Class NumberToBitVector

  • All Implemented Interfaces:
    it.unimi.dsi.bits.TransformationStrategy<java.math.BigInteger>, java.io.Serializable

    public class NumberToBitVector
    extends java.lang.Object
    implements it.unimi.dsi.bits.TransformationStrategy<java.math.BigInteger>
    A transformation strategy that converts strings representing integers between 0 (inclusive) and 2k (exclusive)) into fixed-length binary vectors (most-significant bit is the 0-th).
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      NumberToBitVector​(int width)
      Creates a transformation strategy with given number of binary digits.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      it.unimi.dsi.bits.TransformationStrategy<java.math.BigInteger> copy()  
      long length​(java.math.BigInteger x)  
      static void main​(java.lang.String[] arg)  
      long numBits()  
      it.unimi.dsi.bits.BitVector toBitVector​(java.math.BigInteger x)  
      • Methods inherited from class java.lang.Object

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

      • NumberToBitVector

        public NumberToBitVector​(int width)
        Creates a transformation strategy with given number of binary digits.
        Parameters:
        width - number of binary digits;
    • Method Detail

      • copy

        public it.unimi.dsi.bits.TransformationStrategy<java.math.BigInteger> copy()
        Specified by:
        copy in interface it.unimi.dsi.bits.TransformationStrategy<java.math.BigInteger>
      • numBits

        public long numBits()
        Specified by:
        numBits in interface it.unimi.dsi.bits.TransformationStrategy<java.math.BigInteger>
      • length

        public long length​(java.math.BigInteger x)
        Specified by:
        length in interface it.unimi.dsi.bits.TransformationStrategy<java.math.BigInteger>
      • toBitVector

        public it.unimi.dsi.bits.BitVector toBitVector​(java.math.BigInteger x)
        Specified by:
        toBitVector in interface it.unimi.dsi.bits.TransformationStrategy<java.math.BigInteger>
      • main

        public static void main​(java.lang.String[] arg)