Class IndexEvents
java.lang.Object
org.openpdf.text.pdf.PdfPageEventHelper
org.openpdf.text.pdf.events.IndexEvents
- All Implemented Interfaces:
PdfPageEvent
Class for an index.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Comparator<IndexEvents.Entry> Comparator for sorting the indexprivate longindexcounterprivate List<IndexEvents.Entry> the list for the index entrykeeps the indextag with the pagenumber -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate intcompareStringsIgnoreCase(String str1, String str2) Create an index entry.Create an index entry.Create an index entry.voidCreate an index entry.voidCreate an index entry.voidCreate an index entry.Returns the sorted list with the entries and the collected page numbers.voidonGenericTag(PdfWriter writer, Document document, Rectangle rect, String text) All the text that is passed to this event, gets registered in the indexentry.voidsetComparator(Comparator<IndexEvents.Entry> aComparator) Set the comparator.Methods inherited from class PdfPageEventHelper
onChapter, onChapterEnd, onCloseDocument, onEndPage, onOpenDocument, onParagraph, onParagraphEnd, onSection, onSectionEnd, onStartPage
-
Field Details
-
indextag
-
indexcounter
private long indexcounterindexcounter -
indexentry
the list for the index entry -
comparator
Comparator for sorting the index
-
-
Constructor Details
-
IndexEvents
public IndexEvents()
-
-
Method Details
-
compareStringsIgnoreCase
-
onGenericTag
All the text that is passed to this event, gets registered in the indexentry.- Specified by:
onGenericTagin interfacePdfPageEvent- Overrides:
onGenericTagin classPdfPageEventHelper- Parameters:
writer- thePdfWriterfor this documentdocument- the documentrect- theRectanglecontaining theChunktext- the text of the tag- See Also:
-
create
-
create
-
create
-
create
-
create
-
create
-
setComparator
Set the comparator.- Parameters:
aComparator- The comparator to set.
-
getSortedEntries
Returns the sorted list with the entries and the collected page numbers.- Returns:
- Returns the sorted list with the entries and the collected page numbers.
-