GetVersionNumber() public method

public GetVersionNumber ( ) : int
return int
Example #1
0
        /**
         * @param version version in question
         * @return number of bits used, in this QR Code symbol {@link Version}, to encode the
         *         count of characters that will follow encoded in this {@link Mode}
         */
        public int GetCharacterCountBits(Version version)
        {
            if (characterCountBitsForVersions == null)
            {
                throw new ArgumentException("Character count doesn't apply to this mode");
            }
            int number = version.GetVersionNumber();
            int offset;

            if (number <= 9)
            {
                offset = 0;
            }
            else if (number <= 26)
            {
                offset = 1;
            }
            else
            {
                offset = 2;
            }
            return(characterCountBitsForVersions[offset]);
        }
Example #2
0
 /**
  * @param version version in question
  * @return number of bits used, in this QR Code symbol {@link Version}, to encode the
  *         count of characters that will follow encoded in this {@link Mode}
  */
 public int GetCharacterCountBits(Version version) {
     if (characterCountBitsForVersions == null) {
         throw new ArgumentException("Character count doesn't apply to this mode");
     }
     int number = version.GetVersionNumber();
     int offset;
     if (number <= 9) {
         offset = 0;
     }
     else if (number <= 26) {
         offset = 1;
     }
     else {
         offset = 2;
     }
     return characterCountBitsForVersions[offset];
 }