/** * pretty-prints the GeneralizedCounter. */ public void prettyPrint(PrintWriter pw, String bufferIncrement) { prettyPrint(pw, "", bufferIncrement); }
/** * pretty-prints the GeneralizedCounter, using a buffer increment of two spaces. */ public void prettyPrint(PrintWriter pw) { prettyPrint(pw, " "); }
/** * pretty-prints the GeneralizedCounter to {@link System#out}. */ public void prettyPrint() { prettyPrint(new PrintWriter(System.out, true)); }
private void prettyPrint(PrintWriter pw, String buffer, String bufferIncrement) { if (depth == 1) { for (Map.Entry<?, Double> e: entrySet()) { Object key = e.getKey(); double count = e.getValue(); pw.println(buffer + key + "\t" + count); } } else { for (K key: topLevelKeySet()) { GeneralizedCounter<K> gc1 = conditionalize(Arrays.asList(ErasureUtils.<K[]>uncheckedCast(new Object[]{key}))); pw.println(buffer + key + "\t" + gc1.totalCount()); gc1.prettyPrint(pw, buffer + bufferIncrement, bufferIncrement); } } }
gc2.incrementCount1D("x"); System.out.println("Pretty-printing gc after incrementing gc1:"); gc.prettyPrint(); System.out.println("Total: " + gc.totalCount());
/** * pretty-prints the GeneralizedCounter, using a buffer increment of two spaces. */ public void prettyPrint(PrintWriter pw) { prettyPrint(pw, " "); }
/** * pretty-prints the GeneralizedCounter. */ public void prettyPrint(PrintWriter pw, String bufferIncrement) { prettyPrint(pw, "", bufferIncrement); }
/** * pretty-prints the GeneralizedCounter, using a buffer increment of two spaces. */ public void prettyPrint(PrintWriter pw) { prettyPrint(pw, " "); }
/** * pretty-prints the GeneralizedCounter. */ public void prettyPrint(PrintWriter pw, String bufferIncrement) { prettyPrint(pw, "", bufferIncrement); }
/** * pretty-prints the GeneralizedCounter, using a buffer increment of two spaces. */ public void prettyPrint(PrintWriter pw) { prettyPrint(pw, " "); }
/** * pretty-prints the GeneralizedCounter. */ public void prettyPrint(PrintWriter pw, String bufferIncrement) { prettyPrint(pw, "", bufferIncrement); }
/** * pretty-prints the GeneralizedCounter. */ public void prettyPrint(PrintWriter pw, String bufferIncrement) { prettyPrint(pw, "", bufferIncrement); }
/** * pretty-prints the GeneralizedCounter, using a buffer increment of two spaces. */ public void prettyPrint(PrintWriter pw) { prettyPrint(pw, " "); }
/** * pretty-prints the GeneralizedCounter to {@link System#out}. */ public void prettyPrint() { prettyPrint(new PrintWriter(System.out, true)); }
/** * pretty-prints the GeneralizedCounter to {@link System#out}. */ public void prettyPrint() { prettyPrint(new PrintWriter(System.out, true)); }
/** * pretty-prints the GeneralizedCounter to {@link System#out}. */ public void prettyPrint() { prettyPrint(new PrintWriter(System.out, true)); }
/** * pretty-prints the GeneralizedCounter to {@link System#out}. */ public void prettyPrint() { prettyPrint(new PrintWriter(System.out, true)); }
private void prettyPrint(PrintWriter pw, String buffer, String bufferIncrement) { if (depth == 1) { for (Map.Entry<?, Double> e: entrySet()) { Object key = e.getKey(); double count = e.getValue(); pw.println(buffer + key + "\t" + count); } } else { for (K key: topLevelKeySet()) { GeneralizedCounter<K> gc1 = conditionalize(Arrays.asList(ErasureUtils.<K[]>uncheckedCast(new Object[]{key}))); pw.println(buffer + key + "\t" + gc1.totalCount()); gc1.prettyPrint(pw, buffer + bufferIncrement, bufferIncrement); } } }
private void prettyPrint(PrintWriter pw, String buffer, String bufferIncrement) { if (depth == 1) { for (Map.Entry<?, Double> e: entrySet()) { Object key = e.getKey(); double count = e.getValue(); pw.println(buffer + key + "\t" + count); } } else { for (K key: topLevelKeySet()) { GeneralizedCounter<K> gc1 = conditionalize(Arrays.asList(ErasureUtils.<K[]>uncheckedCast(new Object[]{key}))); pw.println(buffer + key + "\t" + gc1.totalCount()); gc1.prettyPrint(pw, buffer + bufferIncrement, bufferIncrement); } } }
private void prettyPrint(PrintWriter pw, String buffer, String bufferIncrement) { if (depth == 1) { for (Map.Entry<?, Double> e: entrySet()) { Object key = e.getKey(); double count = e.getValue(); pw.println(buffer + key + "\t" + count); } } else { for (K key: topLevelKeySet()) { GeneralizedCounter<K> gc1 = conditionalize(Arrays.asList(ErasureUtils.<K[]>uncheckedCast(new Object[]{key}))); pw.println(buffer + key + "\t" + gc1.totalCount()); gc1.prettyPrint(pw, buffer + bufferIncrement, bufferIncrement); } } }