package org.jvirtanen.parity.reporter;

import static org.jvirtanen.lang.Strings.*;

import org.jvirtanen.parity.net.ptr.PTR;
import org.jvirtanen.parity.net.ptr.PTRListener;
import java.util.Locale;

class Display implements PTRListener {

    private static final double PRICE_FACTOR = 10000.0;

    private static final String HEADER = "" +
        "Timestamp    Inst     Quantity   Price     Buyer    Seller\n" +
        "------------ -------- ---------- --------- -------- --------";

    public Display() {
        printf("\n%s\n", HEADER);
    }

    @Override
    public void trade(PTR.Trade message) {
        printf("%12s %8s %10d %9.2f %8s %8s\n", Timestamps.format(message.timestamp),
                decodeLong(message.instrument), message.quantity, message.price / PRICE_FACTOR,
                decodeLong(message.buyer), decodeLong(message.seller));
    }

    private void printf(String format, Object... args) {
        System.out.printf(Locale.US, format, args);
    }

}

@@ -78,16 +78,41 @@
 ngs.*;%0A%0A
+import java.util.Locale;%0A
 import o
@@ -196,33 +196,8 @@
 ner;
-%0Aimport java.util.Locale;
 %0A%0Acl

Clean up imports in trade reporter