com.sun.tools.doclets.internal.toolkit.util
Class IndexBuilder

java.lang.Object
  extended by com.sun.tools.doclets.internal.toolkit.util.IndexBuilder

public class IndexBuilder
extends java.lang.Object

Build the mapping of each Unicode character with it's member lists containing members names starting with it. Also build a list for all the Unicode characters which start a member name. Member name is classkind or field or method or constructor name. This code is not part of an API. It is implementation that is subject to change. Do not use it as an API

Since:
1.2
See Also:
Character

Nested Class Summary
private  class IndexBuilder.DocComparator
          A comparator used to sort classes and members.
 
Field Summary
private  boolean classesOnly
          Build this Index only for classes?
protected  java.lang.Object[] elements
           
private  java.util.Map<java.lang.Character,java.util.List<Doc>> indexmap
          Mapping of each Unicode Character with the member list containing members with names starting with it.
private  boolean noDeprecated
          Don't generate deprecated information if true.
 
Constructor Summary
IndexBuilder(Configuration configuration, boolean noDeprecated)
          Constructor.
IndexBuilder(Configuration configuration, boolean noDeprecated, boolean classesOnly)
          Constructor.
 
Method Summary
protected  void adjustIndexMap(Doc[] elements)
          Adjust list of members according to their names.
protected  void buildIndexMap(RootDoc root)
          Get all the members in all the Packages and all the Classes given on the command line.
 java.lang.Object[] elements()
          Array of IndexMap keys, Unicode characters.
 java.util.Map<java.lang.Character,java.util.List<Doc>> getIndexMap()
          Return a map of all the individual member lists with Unicode character.
 java.util.List<Doc> getMemberList(java.lang.Character index)
          Return the sorted list of members, for passed Unicode Character.
protected  void putMembersInIndexMap(ClassDoc classdoc)
          Put all the members(fields, methods and constructors) in the classdoc to the indexmap.
protected  boolean shouldAddToIndexMap(Doc element)
          Should this doc element be added to the index map?
protected  void sortIndexMap()
          Sort the index map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

indexmap

private java.util.Map<java.lang.Character,java.util.List<Doc>> indexmap
Mapping of each Unicode Character with the member list containing members with names starting with it.


noDeprecated

private boolean noDeprecated
Don't generate deprecated information if true.


classesOnly

private boolean classesOnly
Build this Index only for classes?


elements

protected final java.lang.Object[] elements
Constructor Detail

IndexBuilder

public IndexBuilder(Configuration configuration,
                    boolean noDeprecated)
Constructor. Build the index map.

Parameters:
configuration - the current configuration of the doclet.
noDeprecated - true if -nodeprecated option is used, false otherwise.

IndexBuilder

public IndexBuilder(Configuration configuration,
                    boolean noDeprecated,
                    boolean classesOnly)
Constructor. Build the index map.

Parameters:
configuration - the current configuration of the doclet.
noDeprecated - true if -nodeprecated option is used, false otherwise.
classesOnly - Include only classes in index.
Method Detail

sortIndexMap

protected void sortIndexMap()
Sort the index map. Traverse the index map for all it's elements and sort each element which is a list.


buildIndexMap

protected void buildIndexMap(RootDoc root)
Get all the members in all the Packages and all the Classes given on the command line. Form separate list of those members depending upon their names.

Parameters:
root - Root of the documemt.

putMembersInIndexMap

protected void putMembersInIndexMap(ClassDoc classdoc)
Put all the members(fields, methods and constructors) in the classdoc to the indexmap.

Parameters:
classdoc - ClassDoc whose members will be added to the indexmap.

adjustIndexMap

protected void adjustIndexMap(Doc[] elements)
Adjust list of members according to their names. Check the first character in a member name, and then add the member to a list of members for that particular unicode character.

Parameters:
elements - Array of members.

shouldAddToIndexMap

protected boolean shouldAddToIndexMap(Doc element)
Should this doc element be added to the index map?


getIndexMap

public java.util.Map<java.lang.Character,java.util.List<Doc>> getIndexMap()
Return a map of all the individual member lists with Unicode character.

Returns:
Map index map.

getMemberList

public java.util.List<Doc> getMemberList(java.lang.Character index)
Return the sorted list of members, for passed Unicode Character.

Parameters:
index - index Unicode character.
Returns:
List member list for specific Unicode character.

elements

public java.lang.Object[] elements()
Array of IndexMap keys, Unicode characters.