Class IndexEntry

java.lang.Object
com.teamten.typeset.IndexEntry
All Implemented Interfaces:
Comparable<IndexEntry>

public class IndexEntry extends Object implements Comparable<IndexEntry>
Stores a single index entry, its physical pages, and its sub-entries.
  • Constructor Details

  • Method Details

    • addPage

      public void addPage(int physicalPageNumber)
      Add the specified page number to our set.
    • mergeWith

      public void mergeWith(IndexEntry other)
      Add the information from the other index entry into this one.
    • getText

      public Block getText()
      Get the text to display in the index.
    • getIndexParagraph

      public Block getIndexParagraph(Sections sections)
      Get the full paragraph to display for this entry in the index.
    • getCategory

      public int getCategory()
      Get the category for this index. This is based on the first letter of the text, so "Alpha" and "Beta" are in different categories, but "Alpha" and "alpha" are the same. All non-alphanumeric characters are in the same category. Returned values are non-negative.
    • getPhysicalPageNumbers

      public List<Integer> getPhysicalPageNumbers()
      Return a sorted list of page numbers for this entry.
    • getSubEntries

      public IndexEntries getSubEntries()
    • println

      public void println(PrintStream stream, String indent)
      Print the entries to the stream.
    • compareTo

      public int compareTo(IndexEntry o)
      Specified by:
      compareTo in interface Comparable<IndexEntry>