public String toString() { StringBuilder builder = new StringBuilder(); for(int i = 0;i<keys.length;i++) { Appendables.appendValue(builder, " Idx:", i); Appendables.appendValue(builder, " Key:", keys[i]); Appendables.appendValue(builder, " Lok:", locked[i]); builder.append("\n"); } return builder.toString(); }
@Override public void render(AppendableByteWriter writer, Enum member, int i, N node) { Appendables.appendValue(writer, member.ordinal()); } });
public static <A extends Appendable> A appendValue(A target, CharSequence label, long value, CharSequence suffix) { try { appendValue(target,label, value); target.append(suffix); return target; } catch (IOException ex) { throw new RuntimeException(ex); } }
public static <A extends Appendable> A appendValue(A target, CharSequence label, int value) { try { target.append(label); return appendValue(target,value); } catch (IOException ex) { throw new RuntimeException(ex); } }
public static <A extends Appendable> A appendValue(A target, CharSequence label, int value, CharSequence suffix) { try { appendValue(target,label, value); target.append(suffix); return target; } catch (IOException ex) { throw new RuntimeException(ex); } }
public static <A extends Appendable> A appendValue(A target, CharSequence label, int value, CharSequence suffix) { try { appendValue(target,label, value); target.append(suffix); return target; } catch (IOException ex) { throw new RuntimeException(ex); } }
private boolean cleanupReport(String label, long newMessages, long totalMessages) throws IOException { if (newMessages>0) { Appendables.appendValue(console.append(" total:"), totalMessages); target.append(label); target.append(console).append("\n"); } return newMessages>0; }
public void writeTo(Appendable target) { try { for(int i = 0; i<count; i++) { Appendables.appendValue(target.append(elements[i].toString()).append(":"),occurences[i]).append(", "); } } catch (IOException e) { throw new RuntimeException(e); } }
@Override public void visitDecimal(String name, long id, int exp, long mant) { writeTab(); try { out.append("{\"").append(name).append("\":["); Appendables.appendValue(out, exp).append(","); Appendables.appendValue(out, mant).append("]}"); } catch (IOException e) { throw new RuntimeException(e); } }
@Override public void visitSignedLong(String name, long id, long value) { writeTab(); try { out.append("{\"").append(name).append("\":"); Appendables.appendValue(out, value); out.append("}"); } catch (IOException e) { throw new RuntimeException(e); } }
@Override public String toString() { StringBuilder builder = new StringBuilder(); Appendables.appendValue(builder, "Clock:", commonClock, "ns Script:"); Appendables.appendArray(builder, '[', script, ']'); return builder.toString(); }
@Override public <A extends Appendable> A appendTo(ChannelReader reader, A target) { return Appendables.appendValue(target, reader.readPackedInt()); } }, // Packed
@Override public <A extends Appendable> A consumeValue(ChannelReader reader, A target) { Appendables.appendValue(target, reader.readPackedLong()); return target; }
@Override public void visitSignedInteger(String name, long id, int value) { writeTab(); try { out.append("{\"").append(name).append("\":"); Appendables.appendValue(out, value); out.append("}"); } catch (IOException e) { throw new RuntimeException(e); } }
@Override public void visitUnsignedInteger(String name, long id, long value) { writeTab(); try { out.append("{\"").append(name).append("\":"); Appendables.appendValue(out, value); out.append("}"); } catch (IOException e) { throw new RuntimeException(e); } }
@Override public void render(AppendableByteWriter writer, T source, int i, N node) { Appendables.appendValue(writer, func.applyAsLong(source, i)); }}); }
@Override public <A extends Appendable> A readRationalAsText(A target) { try { return (A) Appendables.appendValue( Appendables.appendValue(target, readPackedLong()) .append("/"), readPackedLong()); } catch (IOException e) { throw new RuntimeException(e); } }
protected void beginMessage(Appendable t, int cursor) throws IOException { if (buildFullStageWritingToPipe()) { appendStaticCall(t.append(tab).append(tab),pipeClass,"addMsgIdx").append(pipeVarName).append(','); Appendables.appendValue(t, cursor).append(");\n"); } }
private static void appendVolume(AppendableByteWriter<?> target, long traf) { if (traf>9999) { Appendables.appendValue(target.append("Vol:"), traf); } else { Appendables.appendFixedDecimalDigits(target.append("Vol:"), traf, 1000); } }
@Override public void read(ChannelReader reader) { if (reader.available()<1) { //error return; } int age = reader.structured().readInt(Fields.AGE); String name = reader.structured().readText(Fields.NAME); Appendables.appendValue(console.append(name).append(" "),age).append("\n"); } };