/** {@inheritDoc} */ @Override public final String toHuman() { StringBuffer sb = new StringBuffer(100); boolean first = true; sb.append("{"); for (OffsettedItem i : items) { if (first) { first = false; } else { sb.append(", "); } sb.append(i.toHuman()); } sb.append("}"); return sb.toString(); }
/** {@inheritDoc} */ @Override public final String toHuman() { StringBuffer sb = new StringBuffer(100); boolean first = true; sb.append("{"); for (OffsettedItem i : items) { if (first) { first = false; } else { sb.append(", "); } sb.append(i.toHuman()); } sb.append("}"); return sb.toString(); }
/** {@inheritDoc} */ @Override public final String toHuman() { StringBuilder sb = new StringBuilder(100); boolean first = true; sb.append("{"); for (OffsettedItem i : items) { if (first) { first = false; } else { sb.append(", "); } sb.append(i.toHuman()); } sb.append("}"); return sb.toString(); }
/** {@inheritDoc} */ @Override public final String toHuman() { StringBuffer sb = new StringBuffer(100); boolean first = true; sb.append("{"); for (OffsettedItem i : items) { if (first) { first = false; } else { sb.append(", "); } sb.append(i.toHuman()); } sb.append("}"); return sb.toString(); }
/** {@inheritDoc} */ @Override public final String toHuman() { StringBuffer sb = new StringBuffer(100); boolean first = true; sb.append("{"); for (OffsettedItem i : items) { if (first) { first = false; } else { sb.append(", "); } sb.append(i.toHuman()); } sb.append("}"); return sb.toString(); }
/** {@inheritDoc} */ @Override public final String toHuman() { StringBuffer sb = new StringBuffer(100); boolean first = true; sb.append("{"); for (OffsettedItem i : items) { if (first) { first = false; } else { sb.append(", "); } sb.append(i.toHuman()); } sb.append("}"); return sb.toString(); }
/** {@inheritDoc} */ @Override public final String toHuman() { StringBuffer sb = new StringBuffer(100); boolean first = true; sb.append("{"); for (OffsettedItem i : items) { if (first) { first = false; } else { sb.append(", "); } sb.append(i.toHuman()); } sb.append("}"); return sb.toString(); }
/** {@inheritDoc} */ @Override public final String toHuman() { StringBuffer sb = new StringBuffer(100); boolean first = true; sb.append("{"); for (OffsettedItem i : items) { if (first) { first = false; } else { sb.append(", "); } sb.append(i.toHuman()); } sb.append("}"); return sb.toString(); }
/** * Writes an index of contents of the items in this instance of the * given type. If there are none, this writes nothing. If there are any, * then the index is preceded by the given intro string. * * @param out {@code non-null;} where to write to * @param itemType {@code non-null;} the item type of interest * @param intro {@code non-null;} the introductory string for non-empty indices */ public void writeIndexAnnotation(AnnotatedOutput out, ItemType itemType, String intro) { throwIfNotPrepared(); TreeMap<String, OffsettedItem> index = new TreeMap<String, OffsettedItem>(); for (OffsettedItem item : items) { if (item.itemType() == itemType) { String label = item.toHuman(); index.put(label, item); } } if (index.size() == 0) { return; } out.annotate(0, intro); for (Map.Entry<String, OffsettedItem> entry : index.entrySet()) { String label = entry.getKey(); OffsettedItem item = entry.getValue(); out.annotate(0, item.offsetString() + ' ' + label + '\n'); } }
/** * Writes an index of contents of the items in this instance of the * given type. If there are none, this writes nothing. If there are any, * then the index is preceded by the given intro string. * * @param out {@code non-null;} where to write to * @param itemType {@code non-null;} the item type of interest * @param intro {@code non-null;} the introductory string for non-empty indices */ public void writeIndexAnnotation(AnnotatedOutput out, ItemType itemType, String intro) { throwIfNotPrepared(); TreeMap<String, OffsettedItem> index = new TreeMap<String, OffsettedItem>(); for (OffsettedItem item : items) { if (item.itemType() == itemType) { String label = item.toHuman(); index.put(label, item); } } if (index.size() == 0) { return; } out.annotate(0, intro); for (Map.Entry<String, OffsettedItem> entry : index.entrySet()) { String label = entry.getKey(); OffsettedItem item = entry.getValue(); out.annotate(0, item.offsetString() + ' ' + label + '\n'); } }
/** * Writes an index of contents of the items in this instance of the * given type. If there are none, this writes nothing. If there are any, * then the index is preceded by the given intro string. * * @param out {@code non-null;} where to write to * @param itemType {@code non-null;} the item type of interest * @param intro {@code non-null;} the introductory string for non-empty indices */ public void writeIndexAnnotation(AnnotatedOutput out, ItemType itemType, String intro) { throwIfNotPrepared(); TreeMap<String, OffsettedItem> index = new TreeMap<String, OffsettedItem>(); for (OffsettedItem item : items) { if (item.itemType() == itemType) { String label = item.toHuman(); index.put(label, item); } } if (index.size() == 0) { return; } out.annotate(0, intro); for (Map.Entry<String, OffsettedItem> entry : index.entrySet()) { String label = entry.getKey(); OffsettedItem item = entry.getValue(); out.annotate(0, item.offsetString() + ' ' + label + '\n'); } }
/** * Writes an index of contents of the items in this instance of the * given type. If there are none, this writes nothing. If there are any, * then the index is preceded by the given intro string. * * @param out {@code non-null;} where to write to * @param itemType {@code non-null;} the item type of interest * @param intro {@code non-null;} the introductory string for non-empty indices */ public void writeIndexAnnotation(AnnotatedOutput out, ItemType itemType, String intro) { throwIfNotPrepared(); TreeMap<String, OffsettedItem> index = new TreeMap<String, OffsettedItem>(); for (OffsettedItem item : items) { if (item.itemType() == itemType) { String label = item.toHuman(); index.put(label, item); } } if (index.size() == 0) { return; } out.annotate(0, intro); for (Map.Entry<String, OffsettedItem> entry : index.entrySet()) { String label = entry.getKey(); OffsettedItem item = entry.getValue(); out.annotate(0, item.offsetString() + ' ' + label + '\n'); } }
String label = item.toHuman(); index.put(label, item);
/** * Writes an index of contents of the items in this instance of the * given type. If there are none, this writes nothing. If there are any, * then the index is preceded by the given intro string. * * @param out {@code non-null;} where to write to * @param itemType {@code non-null;} the item type of interest * @param intro {@code non-null;} the introductory string for non-empty indices */ public void writeIndexAnnotation(AnnotatedOutput out, ItemType itemType, String intro) { throwIfNotPrepared(); TreeMap<String, OffsettedItem> index = new TreeMap<String, OffsettedItem>(); for (OffsettedItem item : items) { if (item.itemType() == itemType) { String label = item.toHuman(); index.put(label, item); } } if (index.size() == 0) { return; } out.annotate(0, intro); for (Map.Entry<String, OffsettedItem> entry : index.entrySet()) { String label = entry.getKey(); OffsettedItem item = entry.getValue(); out.annotate(0, item.offsetString() + ' ' + label + '\n'); } }
/** * Writes an index of contents of the items in this instance of the * given type. If there are none, this writes nothing. If there are any, * then the index is preceded by the given intro string. * * @param out {@code non-null;} where to write to * @param itemType {@code non-null;} the item type of interest * @param intro {@code non-null;} the introductory string for non-empty indices */ public void writeIndexAnnotation(AnnotatedOutput out, ItemType itemType, String intro) { throwIfNotPrepared(); TreeMap<String, OffsettedItem> index = new TreeMap<String, OffsettedItem>(); for (OffsettedItem item : items) { if (item.itemType() == itemType) { String label = item.toHuman(); index.put(label, item); } } if (index.size() == 0) { return; } out.annotate(0, intro); for (Map.Entry<String, OffsettedItem> entry : index.entrySet()) { String label = entry.getKey(); OffsettedItem item = entry.getValue(); out.annotate(0, item.offsetString() + ' ' + label + '\n'); } }
/** * Writes an index of contents of the items in this instance of the * given type. If there are none, this writes nothing. If there are any, * then the index is preceded by the given intro string. * * @param out {@code non-null;} where to write to * @param itemType {@code non-null;} the item type of interest * @param intro {@code non-null;} the introductory string for non-empty indices */ public void writeIndexAnnotation(AnnotatedOutput out, ItemType itemType, String intro) { throwIfNotPrepared(); TreeMap<String, OffsettedItem> index = new TreeMap<String, OffsettedItem>(); for (OffsettedItem item : items) { if (item.itemType() == itemType) { String label = item.toHuman(); index.put(label, item); } } if (index.size() == 0) { return; } out.annotate(0, intro); for (Map.Entry<String, OffsettedItem> entry : index.entrySet()) { String label = entry.getKey(); OffsettedItem item = entry.getValue(); out.annotate(0, item.offsetString() + ' ' + label + '\n'); } }