Package com.lowagie.text.pdf.events
Class IndexEvents
java.lang.Object
com.lowagie.text.pdf.PdfPageEventHelper
com.lowagie.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 long
indexcounterprivate List
<IndexEvents.Entry> the list for the index entrykeeps the indextag with the pagenumber -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Create an index entry.void
Create an index entry.void
Create an index entry.Create an index entry.Create an index entry.Create an index entry.Returns the sorted list with the entries and the collected page numbers.void
onGenericTag
(PdfWriter writer, Document document, Rectangle rect, String text) All the text that is passed to this event, gets registered in the indexentry.void
setComparator
(Comparator<IndexEvents.Entry> aComparator) Set the comparator.Methods inherited from class com.lowagie.text.pdf.PdfPageEventHelper
onChapter, onChapterEnd, onCloseDocument, onEndPage, onOpenDocument, onParagraph, onParagraphEnd, onSection, onSectionEnd, onStartPage
-
Field Details
-
indextag
keeps the indextag with the pagenumber -
indexcounter
private long indexcounterindexcounter -
indexentry
the list for the index entry -
comparator
Comparator for sorting the index
-
-
Constructor Details
-
IndexEvents
public IndexEvents()
-
-
Method Details
-
onGenericTag
All the text that is passed to this event, gets registered in the indexentry.- Specified by:
onGenericTag
in interfacePdfPageEvent
- Overrides:
onGenericTag
in classPdfPageEventHelper
- Parameters:
writer
- thePdfWriter
for this documentdocument
- the documentrect
- theRectangle
containing theChunk
text
- the text of the tag- See Also:
-
create
Create an index entry.- Parameters:
text
- The text for the Chunk.in1
- The first level.in2
- The second level.in3
- The third level.- Returns:
- Returns the Chunk.
-
create
Create an index entry.- Parameters:
text
- The text for the Chunk.in1
- The first level.- Returns:
- Returns the Chunk.
-
create
Create an index entry.- Parameters:
text
- The text for the Chunk.in1
- The first level.in2
- The second level.- Returns:
- Returns the Chunk.
-
create
Create an index entry.- Parameters:
text
- The text.in1
- The first level.in2
- The second level.in3
- The third level.
-
create
Create an index entry.- Parameters:
text
- The text.in1
- The first level.
-
create
Create an index entry.- Parameters:
text
- The text.in1
- The first level.in2
- The second level.
-
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.
-