// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/ToStringUtils.java
// protected static final int BLOCK_BASE = 36;
// 
// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/ToStringUtils.java
// public static final String BLOCK_INNER_SEPARATOR = "/";
// 
// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/ToStringUtils.java
// protected static final int BLOCK_MAX_CHARS =
//         2 * BLOCK_INT_MAX_CHARS + BLOCK_INNER_SEPARATOR.length();
// 
// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/UniformFuzzyHash.java
// protected static final int BLOCK_HASH_MODULO = Integer.MAX_VALUE;


import static com.github.s3curitybug.similarityuniformfuzzyhash.ToStringUtils.BLOCK_BASE;
import static com.github.s3curitybug.similarityuniformfuzzyhash.ToStringUtils.BLOCK_INNER_SEPARATOR;
import static com.github.s3curitybug.similarityuniformfuzzyhash.ToStringUtils.BLOCK_MAX_CHARS;
import static com.github.s3curitybug.similarityuniformfuzzyhash.UniformFuzzyHash.BLOCK_HASH_MODULO;

package com.github.s3curitybug.similarityuniformfuzzyhash;


/**
 * This class represents a Uniform Fuzzy Hash block.
 * 
 * @author s3curitybug@gmail.com
 *
 */
public class UniformFuzzyHashBlock {

    /**
     * Block hash.
     */
    private int blockHash;

    /**
     * Block starting byte position (0 based).
     */
    private int blockStartingBytePosition;

    /**
     * Block ending byte position (0 based).
     */
    private int blockEndingBytePosition;

    /**
     * Base constructor.
     */
    private UniformFuzzyHashBlock() {

        this.blockHash = 0;
        this.blockStartingBytePosition = 0;
        this.blockEndingBytePosition = 0;

    }

    /**
     * Constructor with arguments.
     * 
     * @param blockHash Block hash.
     * @param blockStartingBytePosition Block starting byte position (0 based).
     * @param blockEndingBytePosition Block ending byte position (0 based).
     */
    protected UniformFuzzyHashBlock(
            int blockHash,
            int blockStartingBytePosition,
            int blockEndingBytePosition) {

        this.blockHash = blockHash;
        this.blockStartingBytePosition = blockStartingBytePosition;
        this.blockEndingBytePosition = blockEndingBytePosition;

    }

    /**
     * @return The string representation of this Uniform Fuzzy Hash Block.
     */
    @Override
    public String toString() {

        StringBuilder strB = new StringBuilder(BLOCK_MAX_CHARS);
        toString(strB);
        return strB.toString();

    }

    /**
     * Appends the string representation of this Uniform Fuzzy Hash Block to an existing
     * String Builder.
     * 
     * @param strB String Builder to which the string representation of this Uniform Fuzzy Hash
     *        Block will be appended.
     */
    protected void toString(
            StringBuilder strB) {


// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/ToStringUtils.java
// protected static final int BLOCK_BASE = 36;
// 
// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/ToStringUtils.java
// public static final String BLOCK_INNER_SEPARATOR = "/";
// 
// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/ToStringUtils.java
// protected static final int BLOCK_MAX_CHARS =
//         2 * BLOCK_INT_MAX_CHARS + BLOCK_INNER_SEPARATOR.length();
// 
// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/UniformFuzzyHash.java
// protected static final int BLOCK_HASH_MODULO = Integer.MAX_VALUE;


// Path: src/main/java/com/github/s3curitybug/similarityuniformfuzzyhash/UniformFuzzyHashBlock.java
import static com.github.s3curitybug.similarityuniformfuzzyhash.ToStringUtils.BLOCK_BASE;
import static com.github.s3curitybug.similarityuniformfuzzyhash.ToStringUtils.BLOCK_INNER_SEPARATOR;
import static com.github.s3curitybug.similarityuniformfuzzyhash.ToStringUtils.BLOCK_MAX_CHARS;
import static com.github.s3curitybug.similarityuniformfuzzyhash.UniformFuzzyHash.BLOCK_HASH_MODULO;

package com.github.s3curitybug.similarityuniformfuzzyhash;


/**
 * This class represents a Uniform Fuzzy Hash block.
 * 
 * @author s3curitybug@gmail.com
 *
 */
public class UniformFuzzyHashBlock {

    /**
     * Block hash.
     */
    private int blockHash;

    /**
     * Block starting byte position (0 based).
     */
    private int blockStartingBytePosition;

    /**
     * Block ending byte position (0 based).
     */
    private int blockEndingBytePosition;

    /**
     * Base constructor.
     */
    private UniformFuzzyHashBlock() {

        this.blockHash = 0;
        this.blockStartingBytePosition = 0;
        this.blockEndingBytePosition = 0;

    }

    /**
     * Constructor with arguments.
     * 
     * @param blockHash Block hash.
     * @param blockStartingBytePosition Block starting byte position (0 based).
     * @param blockEndingBytePosition Block ending byte position (0 based).
     */
    protected UniformFuzzyHashBlock(
            int blockHash,
            int blockStartingBytePosition,
            int blockEndingBytePosition) {

        this.blockHash = blockHash;
        this.blockStartingBytePosition = blockStartingBytePosition;
        this.blockEndingBytePosition = blockEndingBytePosition;

    }

    /**
     * @return The string representation of this Uniform Fuzzy Hash Block.
     */
    @Override
    public String toString() {

        StringBuilder strB = new StringBuilder(BLOCK_MAX_CHARS);
        toString(strB);
        return strB.toString();

    }

    /**
     * Appends the string representation of this Uniform Fuzzy Hash Block to an existing
     * String Builder.
     * 
     * @param strB String Builder to which the string representation of this Uniform Fuzzy Hash
     *        Block will be appended.
     */
    protected void toString(
            StringBuilder strB) {


        strB.append(Integer.toString(blockHash, BLOCK_BASE));
