Package net.fec.openrq.util.io.printing.appendable

Examples of net.fec.openrq.util.io.printing.appendable.PrintableAppendable


     * @param appendable
     *            the appendable on which the matrix is printed
     */
    public static void printMatrix(ByteMatrix matrix, Appendable appendable) {

        final PrintableAppendable output = PrintableAppendable.of(appendable, true);
        final int R = matrix.rows();
        final int C = matrix.columns();

        // this prints a line with column indexes and a line for each row preceded by a row index
        // (this only works fine for indices less than 100)
        output.printf("   ");
        for (int j = 0; j < C; j++)
            output.printf("* %02d ", j);

        output.println('|');

        for (int i = 0; i < R; i++) {
            output.printf("%02d)", i);
            for (int j = 0; j < C; j++)
                output.printf("| %02X ", matrix.get(i, j));
            output.println('|');
        }
    }
View Full Code Here


     * @param appendable
     *            the appendable on which the vector is printed
     */
    public static void printVector(ByteVector vector, Appendable appendable) {

        final PrintableAppendable output = PrintableAppendable.of(appendable, true);
        final int N = vector.length();

        // this prints two lines, the first with indexes and the second with the actual values
        // (this only works fine for indices less than 100)
        // for (int j = 0; j < N; j++)
        // output.printf("* %02d ", j);

        // output.println('|');

        for (int j = 0; j < N; j++)
            output.printf("| %02X ", vector.get(j));
        output.println('|');
    }
View Full Code Here

TOP

Related Classes of net.fec.openrq.util.io.printing.appendable.PrintableAppendable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.