SplitIndexWriterpublic class SplitIndexWriter extends AbstractIndexWriter Generate Separate Index Files for all the member names with Indexing in
Unicode Order. This will create "index-files" directory in the current or
destination directory and will generate separate file for each unicode index. |
Fields Summary |
---|
protected int | prevPrevious unicode character index in the built index. | protected int | nextNext unicode character in the built index. |
Constructors Summary |
---|
public SplitIndexWriter(String path, String filename, String relpath, IndexBuilder indexbuilder, int prev, int next)Construct the SplitIndexWriter. Uses path to this file and relative path
from this file.
super(path, filename, relpath, indexbuilder);
this.prev = prev;
this.next = next;
|
Methods Summary |
---|
public static void | generate(IndexBuilder indexbuilder)Generate separate index files, for each Unicode character, listing all
the members starting with the particular unicode character.
SplitIndexWriter indexgen;
String filename = "";
String path = DirectoryManager.getPath("index-files");
String relpath = DirectoryManager.getRelativePath("index-files");
try {
for (int i = 0; i < indexbuilder.elements().length; i++) {
int j = i + 1;
int prev = (j == 1)? -1: i;
int next = (j == indexbuilder.elements().length)? -1: j + 1;
filename = "index-" + j +".html";
indexgen = new SplitIndexWriter(path, filename, relpath,
indexbuilder, prev, next);
indexgen.generateIndexFile((Character)indexbuilder.
elements()[i]);
indexgen.close();
}
} catch (IOException exc) {
Standard.configuration().standardmessage.error("doclet.exception_encountered",
exc.toString(), filename);
throw new DocletAbortException();
}
| protected void | generateIndexFile(java.lang.Character unicode)Generate the contents of each index file, with Header, Footer,
Member Field, Method and Constructor Description.
printHeader(getText("doclet.Window_Split_Index",
Standard.configuration().windowtitle,
unicode.toString()));
navLinks(true);
printLinksForIndexes();
hr();
generateContents(unicode, indexbuilder.getMemberList(unicode));
navLinks(false);
printLinksForIndexes();
printBottom();
printBodyHtmlEnd();
| protected void | navLinkNext()Print the next unicode character index link.
if (next == -1) {
printText("doclet.Next_Letter");
} else {
printHyperLink("index-" + next + ".html","",
getText("doclet.Next_Letter"), true);
}
| protected void | navLinkPrevious()Print the previous unicode character index link.
if (prev == -1) {
printText("doclet.Prev_Letter");
} else {
printHyperLink("index-" + prev + ".html", "",
getText("doclet.Prev_Letter"), true);
}
| protected void | printLinksForIndexes()Print Links for all the Index Files per unicode character.
for (int i = 0; i < indexbuilder.elements().length; i++) {
int j = i + 1;
printHyperLink("index-" + j + ".html",
indexbuilder.elements()[i].toString());
print(' ");
}
|
|