public Huff(int domain) {
        this.domain = domain;
        int length = domain * 2 - 1;
        this.symbols = new Symbol[length];

// Make the leaf symbols.

        for (int i = 0; i < domain; i += 1) {
            symbols[i] = new Symbol(i);
        }

// SMake the links.

        for (int i = domain; i < length; i += 1) {
            symbols[i] = new Symbol(none);
        }
    }