/** * Returns the sorted list with the entries and the collected page numbers. * @return Returns the sorted list with the entries and the collected page numbers. */ public List getSortedEntries() { Map grouped = new HashMap(); for (int i = 0; i < indexentry.size(); i++) { Entry e = (Entry) indexentry.get(i); String key = e.getKey(); Entry master = (Entry) grouped.get(key); if (master != null) { master.addPageNumberAndTag(e.getPageNumber(), e.getTag()); } else { e.addPageNumberAndTag(e.getPageNumber(), e.getTag()); grouped.put(key, e); } } // copy to a list and sort it List sorted = new ArrayList(grouped.values()); Collections.sort(sorted, comparator); return sorted; }
public int compare(Object arg0, Object arg1) { Entry en1 = (Entry) arg0; Entry en2 = (Entry) arg1; int rt = 0; if (en1.getIn1() != null && en2.getIn1() != null) { if ((rt = en1.getIn1().compareToIgnoreCase(en2.getIn1())) == 0) { // in1 equals if (en1.getIn2() != null && en2.getIn2() != null) { if ((rt = en1.getIn2() .compareToIgnoreCase(en2.getIn2())) == 0) { // in2 equals if (en1.getIn3() != null && en2.getIn3() != null) { rt = en1.getIn3().compareToIgnoreCase( en2.getIn3()); } } } } } return rt; } };
public int compare(Object arg0, Object arg1) { Entry en1 = (Entry) arg0; Entry en2 = (Entry) arg1; int rt = 0; if (en1.getIn1() != null && en2.getIn1() != null) { if ((rt = en1.getIn1().compareToIgnoreCase(en2.getIn1())) == 0) { // in1 equals if (en1.getIn2() != null && en2.getIn2() != null) { if ((rt = en1.getIn2() .compareToIgnoreCase(en2.getIn2())) == 0) { // in2 equals if (en1.getIn3() != null && en2.getIn3() != null) { rt = en1.getIn3().compareToIgnoreCase( en2.getIn3()); } } } } } return rt; } };
/** * Returns the sorted list with the entries and the collected page numbers. * @return Returns the sorted list with the entries and the collected page numbers. */ public List getSortedEntries() { Map grouped = new HashMap(); for (int i = 0; i < indexentry.size(); i++) { Entry e = (Entry) indexentry.get(i); String key = e.getKey(); Entry master = (Entry) grouped.get(key); if (master != null) { master.addPageNumberAndTag(e.getPageNumber(), e.getTag()); } else { e.addPageNumberAndTag(e.getPageNumber(), e.getTag()); grouped.put(key, e); } } // copy to a list and sort it List sorted = new ArrayList(grouped.values()); Collections.sort(sorted, comparator); return sorted; }
/** * Create an index entry. * * @param text The text for the Chunk. * @param in1 The first level. * @param in2 The second level. * @param in3 The third level. * @return Returns the Chunk. */ public Chunk create(final String text, final String in1, final String in2, final String in3) { Chunk chunk = new Chunk(text); String tag = "idx_" + (indexcounter++); chunk.setGenericTag(tag); chunk.setLocalDestination(tag); Entry entry = new Entry(in1, in2, in3, tag); indexentry.add(entry); return chunk; }
/** * Create an index entry. * * @param text The text for the Chunk. * @param in1 The first level. * @param in2 The second level. * @param in3 The third level. * @return Returns the Chunk. */ public Chunk create(final String text, final String in1, final String in2, final String in3) { Chunk chunk = new Chunk(text); String tag = "idx_" + (indexcounter++); chunk.setGenericTag(tag); chunk.setLocalDestination(tag); Entry entry = new Entry(in1, in2, in3, tag); indexentry.add(entry); return chunk; }
public int compare(Object arg0, Object arg1) { Entry en1 = (Entry) arg0; Entry en2 = (Entry) arg1; int rt = 0; if (en1.getIn1() != null && en2.getIn1() != null) { if ((rt = en1.getIn1().compareToIgnoreCase(en2.getIn1())) == 0) { // in1 equals if (en1.getIn2() != null && en2.getIn2() != null) { if ((rt = en1.getIn2() .compareToIgnoreCase(en2.getIn2())) == 0) { // in2 equals if (en1.getIn3() != null && en2.getIn3() != null) { rt = en1.getIn3().compareToIgnoreCase( en2.getIn3()); } } } } } return rt; } };
/** * Returns the sorted list with the entries and the collected page numbers. * @return Returns the sorted list with the entries and the collected page numbers. */ public List getSortedEntries() { Map grouped = new HashMap(); for (int i = 0; i < indexentry.size(); i++) { Entry e = (Entry) indexentry.get(i); String key = e.getKey(); Entry master = (Entry) grouped.get(key); if (master != null) { master.addPageNumberAndTag(e.getPageNumber(), e.getTag()); } else { e.addPageNumberAndTag(e.getPageNumber(), e.getTag()); grouped.put(key, e); } } // copy to a list and sort it List sorted = new ArrayList(grouped.values()); Collections.sort(sorted, comparator); return sorted; }
/** * Create an index entry. * * @param text The text for the Chunk. * @param in1 The first level. * @param in2 The second level. * @param in3 The third level. * @return Returns the Chunk. */ public Chunk create(final String text, final String in1, final String in2, final String in3) { Chunk chunk = new Chunk(text); String tag = "idx_" + (indexcounter++); chunk.setGenericTag(tag); chunk.setLocalDestination(tag); Entry entry = new Entry(in1, in2, in3, tag); indexentry.add(entry); return chunk; }
/** * Create an index entry. * * @param text The text. * @param in1 The first level. * @param in2 The second level. * @param in3 The third level. */ public void create(final Chunk text, final String in1, final String in2, final String in3) { String tag = "idx_" + (indexcounter++); text.setGenericTag(tag); text.setLocalDestination(tag); Entry entry = new Entry(in1, in2, in3, tag); indexentry.add(entry); }
/** * Create an index entry. * * @param text The text. * @param in1 The first level. * @param in2 The second level. * @param in3 The third level. */ public void create(final Chunk text, final String in1, final String in2, final String in3) { String tag = "idx_" + (indexcounter++); text.setGenericTag(tag); text.setLocalDestination(tag); Entry entry = new Entry(in1, in2, in3, tag); indexentry.add(entry); }
/** * Create an index entry. * * @param text The text. * @param in1 The first level. * @param in2 The second level. * @param in3 The third level. */ public void create(final Chunk text, final String in1, final String in2, final String in3) { String tag = "idx_" + (indexcounter++); text.setGenericTag(tag); text.setLocalDestination(tag); Entry entry = new Entry(in1, in2, in3, tag); indexentry.add(entry); }