Package Torello.JavaDoc
Class SummaryTableHTML<ENTITY extends Declaration>
- java.lang.Object
-
- Torello.JavaDoc.SummaryTableHTML<ENTITY>
-
- Type Parameters:
ENTITY- This will take one of six type's:Method,Constructor,Field,EnumConstant,AnnotationElemorNestedType. The HTML contained by this class correspond directly to the HTML contained by a Summary-Table of one of section of one of these Entities / Members.
public class SummaryTableHTML<ENTITY extends Declaration> extends java.lang.Object
Optional-Extension Class of a Simple-Upgrade:
Running a Standard-Upgrade on a Java-Doc Web-Page Directory-Tree only requires building an instance of classUpgrade, and executing itsupgrade()method!
The Standard-Upgrade Process will insert CSS-Tags, Hi-Lite Properly-Marked Code-Snippet<DIV>'s, Hi-Lite all Method-Bodies & Field-Declarations, and even create Navigation-Menu Links. If more fine-grained control is needed, this class provides direct access to the Java Doc Web-Page HTML.
Accessing this Class:
This class may be accessed by utilizing a configuration method in classUpgrade, specifically calling:
Upgrade.setExtraTasks(Consumer<JavaDocHTMLFile> handler)
... with a handler (ajava.util.function.Consumerinstance) that receives aJavaDocHTMLFileinstance.
ClassJavaDocHTMLFileprovides access to every HTML Component on a Java-Doc Web-Page. If programmatic changes to a Java-Doc Web-Page are needed, these Reflection-API classes make it easy to change, update, remove & add-to the HTML on these pages. Simply registering a handler with theUpgrader, make the necessary improvements, and they will be incorporated into the final-output HTML-Page.
Again, classJavaDocHTMLFilehas getters for:HeaderFooterHTML,SummaryTableHTMLandReflHTML
Access Alternative:
Creating an instance of one of the two offered "User-Processor" classes - both of which have several listener/handler methods - is also a great way to access the Reflection-HTML API. These two Java Interfaces are:
This class stores the HTML for a Summary-Table - which is the table at the top of a Java Doc Page listing all of one type of entities present in the CIET/Type.This Class May be Used to Programmatically Modify JavaDoc HTML
Modifying JavaDoc HTML can be done using:JavaDocHTMLFile,SummaryTableHTML,ReflHTMLandHeaderFooterHTML.
To get instances of these classes, just register a listener with the Upgrader using:Upgrade.setExtraTasks
This is optional, as the Standard Upgrader-Features do not necessitate use of this class.
There are several possible Summary-Tables, inclusive of:- Method Summaries
- Field Summaries
- Constructor Summaries
- Enum Constant Summaries
- Optional Annotation Element Summaries
- Requires Annotation Element Summaries
- Inner-Class Summaries
Hi-Lited Source-Code:- View Here: Torello/JavaDoc/SummaryTableHTML.java
- Open New Browser-Tab: Torello/JavaDoc/SummaryTableHTML.java
File Size: 48,554 Bytes Line Count: 1,101 '\n' Characters Found
-
-
Nested Class Summary
Nested Classes Modifier and Type Class static classSummaryTableHTML.ColNames
-
Field Summary
Serializable ID Modifier and Type Field protected static longserialVersionUIDSummary-Table Type, as the Entity 'enum' Modifier and Type Field EntitytableTypeHTML <TABLE>and</TABLE>Tag DefinitionsModifier and Type Field TagNodeIndextableCloseTagNodeIndextableOpenBack-Pointer to the Java-Doc Web-Page Object containing this Table Modifier and Type Field JavaDocHTMLFilejdhfMarker-Booleans: Indicates whether or not Summary-Sentences have been removed Modifier and Type Field booleanretainRemoveDescriptionsMarker-Booleans: Indicating Column Number in the Original Table Modifier and Type Field intnumColumnsInOriginalTableTable-Column Names, as ReadOnlyList's Modifier and Type Field ReadOnlyList<SummaryTableHTML.ColNames>initialColumnsReadOnlyList<SummaryTableHTML.ColNames>postProcessedColumns
-
Constructor Summary
Constructors Constructor SummaryTableHTML(TagNodeIndex openingCinzelH3, Entity tableType, TagNodeIndex tableOpen, TagNodeIndex tableClose, JavaDocHTMLFile jdhf, Vector<HTMLNode> headerRow, Vector<Vector<HTMLNode>> tableRows, Vector<ENTITY> rowEntities, boolean retainRemoveDescriptions, int numColumnsInOriginalTable, ReadOnlyList<SummaryTableHTML.ColNames> initialColumns, ReadOnlyList<SummaryTableHTML.ColNames> postProcessedColumns)
-
Method Summary
Retrieve *PARTIAL* Table-Row <TR> ... </TR>Data, selected by Row-IndexModifier and Type Method ReflHTML<ENTITY>getRowDetail(int rowIndex)ENTITYgetRowEntity(int rowIndex)Vector<HTMLNode>getRowHTML(int rowIndex)Retrieve all *ALL* Table-Row <TR> ... </TR>Data, selected by Row-IndexModifier and Type Method Ret2<ReflHTML<ENTITY>,
Vector<HTMLNode>>getRowDetailAndHTML(int rowIndex)Ret2<ENTITY,Vector<HTMLNode>>getRowEntityAndHTML(int rowIndex)Ask for the Number of HTML Table-Rows, and the Kind of Rows which are Present Modifier and Type Method boolean[]memberRows()intnumRows()intnumSignatureRows()intnumTitleBarRows()Retrieve a Stream containing *PART* of the <TR> ... </TR>Row-Data Present in the TableModifier and Type Method Stream<ENTITY>rowEntityStream()Stream<Vector<HTMLNode>>rowHTMLStream()Retrieve a Stream containing *ALL* of the <TR> ... </TR>Row-Data Present in the TableModifier and Type Method Stream<Ret2<ENTITY,
Vector<HTMLNode>>>entityAndHTMLStream()Stream<Ret2<ReflHTML<ENTITY>,
Vector<HTMLNode>>>reflAndHTMLStream()Find a Table-Row Index, by Name, for a Field, EnumConstant or AnnotationElem Modifier and Type Method intfind(String name)Find Table-Row(s) Indices, by Name, for a Method or Constructor Modifier and Type Method IntStreamfindAll(String methodOrCtorName)IntStreamfindAll(String methodOrCtorName, int numParams)intfindFirst(String methodOrCtorName)intfindFirst(String methodOrCtorName, int numParams)Quick Debugging Printer & toString()Modifier and Type Method voiddebugPrint(Appendable a)StringdebugPrintDense(int numCharsWide)StringtoString()
-
-
-
Field Detail
-
serialVersionUID
protected static final long serialVersionUID
This fulfils the SerialVersion UID requirement for all classes that implement Java'sinterface java.io.Serializable. Using theSerializableImplementation offered by java is very easy, and can make saving program state when debugging a lot easier. It can also be used in place of more complicated systems like "hibernate" to store data as well.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
protected static final long serialVersionUID = 1;
-
tableType
-
tableOpen
public final TagNodeIndex tableOpen
The opening<TABLE>tag, for a Summary-Section Table- Code:
- Exact Field Declaration Expression:
public final TagNodeIndex tableOpen;
-
tableClose
public final TagNodeIndex tableClose
The closing</TABLE>tag, for a Summary-Section Table- Code:
- Exact Field Declaration Expression:
public final TagNodeIndex tableClose;
-
jdhf
public final JavaDocHTMLFile jdhf
This is just a "Back-Pointer" to theJavaDocHTMLFilethat contains this Summary-Table- Code:
- Exact Field Declaration Expression:
public final JavaDocHTMLFile jdhf;
-
retainRemoveDescriptions
public final boolean retainRemoveDescriptions
Thisfinal/ constantboolean-Flag is simply provided to indicate whether or not the Upgrader-Logic has removed the Summary-Description Setences from the Table-Rows of this table.
The default behavior for this Upgrader-Tool is to remove all Summary-Sentences for every type / kind of Entity-Summary Table on each Java-Doc Web-Page. Note, though, that this "Default Behavior" is easily by-passed by providing a simplePredicateto the Upgrader-Tool's Configuration-ClassUpgrade.setSummaryRemoveFilter(Predicate).
It shall be "an eventuality" to provide a "Fine Grained Control" over this removal Descision-Predicate so that a user may specify which Entity Summary-Tables retain their Summary-Sentences, and which shall have them stripped or removed from their Web-Page UI's.
As of March of 2025, this feature is not available yet. Either ALL Summary-Sentences must be removed from EVERY Summary-Table located at the top of a Java-Doc Web-Page, *OR* none of them shall be removed.
Again, see the Configuration-Setting Method in classUpgradeto read more about this feature:setSummaryRemoveFilter- Code:
- Exact Field Declaration Expression:
public final boolean retainRemoveDescriptions;
-
numColumnsInOriginalTable
public final int numColumnsInOriginalTable
The following integer should be an accurate count on the **ORIGINAL** number of columns that were created by 'javadoc' when the original HTML-Table was output. For every one of the Summary-Tables, this is an easy computation, except, apparently for Constructors...- Code:
- Exact Field Declaration Expression:
public final int numColumnsInOriginalTable;
-
initialColumns
public final ReadOnlyList<SummaryTableHTML.ColNames> initialColumns
The column names present in this Summary-HTML Table. To view the JDK-Standard Columns which are present in a Java-Doc Summary-Table, please review the contents of this table- Code:
- Exact Field Declaration Expression:
public final ReadOnlyList<ColNames> initialColumns;
-
postProcessedColumns
public final ReadOnlyList<SummaryTableHTML.ColNames> postProcessedColumns
One of the commonly features of the Upgrader-Tool is to remove the Summary-Sentence Description-Column from the Entities in a Java-Doc Web-Page. When this occurs, theSummaryTableHTML.ColNames.Descriptioncolumn is removed.
When theDescription-Column of a Summary-Table has been removed, this list will contain one fewer element than the contents of the listinitialColumns- Code:
- Exact Field Declaration Expression:
public final ReadOnlyList<ColNames> postProcessedColumns;
-
-
Method Detail
-
numRows
public int numRows()
Retrieve the total number of Table-Rows in the Summary-Table.- Returns:
- The number of HTML
<TR>...</TR>elements in this Summary-Table - Code:
- Exact Method Body:
return tableRows.size();
-
numTitleBarRows
public int numTitleBarRows()
Retrieve the number of Table-Rows that have Title-Bars in this Summary-Table.- Returns:
- The number of HTML
<TR>...</TR>elements in this Summary-Table which contain Title-Bars, rather than entity/member signature URL-Links. - Code:
- Exact Method Body:
int counter = 0; for (ENTITY e : rowEntities) if (e == null) counter++; return counter;
-
numSignatureRows
public int numSignatureRows()
Retrieve the number of Entity/Member Signatures which occupy a Table-Row in this Summary-Table- Returns:
- The number of HTML
<TR>...</TR>elements in this Summary-Table which contain entity/member signature URL-Links. - Code:
- Exact Method Body:
int counter = 0; for (ENTITY e : rowEntities) if (e != null) counter++; return counter;
-
memberRows
public boolean[] memberRows()
This method simply scans the internal'rowEntities'list /Vectorto check each element to determine if it contains one of the User-Provided descriptive orange-banner titles, or contains an actual Entity/MemberURL-Link.
The members of a type are listed in enumEntity. JavaDoc Upgrader refers to Class or Interface members as "Entities." A Summary-Table on a Java-Doc Page - after a Summary HTML Table Sort - will have some HTML Table-Rows with Members / Entities, and some Rows having orange-colored horizontal banner Title-Bars.
When the HTML Table-Row ('<TR> ... </TR>') has an<A>-URLlink to one of the members of the class (a method, field, constructor, etc...), the returned array will containTRUEfor that index. When the row contains a Title-Bar, the array-index for that row will containFALSE.- Returns:
- A
boolean[]-Array whose length is equal to the number of rows in this Summary-Table, and whosebooleanvalues areTRUEif the Table-Row contains aURL-Link to one of the entities (Methods, Constructors, Fields, etc...) of the CIET / Type. - Code:
- Exact Method Body:
boolean[] ret = new boolean[rowEntities.size()]; int i = 0; for (ENTITY e : rowEntities) ret[i++] = (e != null); return ret;
-
getRowDetail
public ReflHTML<ENTITY> getRowDetail(int rowIndex)
If you have a chosen / desired HTML Summary-Table Row (with a selected summary element/item) - you may pass the table-row index of that item to retrieve therowIndexth instance ofReflHTMLthat contains the Detail-Element Parsed-HTML corresponding to that row.- Parameters:
rowIndex- Any one of the Summary-HTML Table-Rows. Each Summary-Table Row is either a Title-Bar<TR>/ Row, or it is aEntity/ Member Table<TR>Row.Entity-Rows are HTML<TR>-Rows that simply contain an Anchor<A>link to one of this CIET's Members / Entites.
For example, if'this'Summary-Table instance were for Method's, and the Table-Row index for the'toString()'Method were passed to parameter'rowIndex', this method would return theReflHTMLfor thetoStringMethod.
The returnedReflHTMLinstance would contain all of the parsed HTML information for the methodtoString.
If this parameter points to a Table-Row that contains an Orange-Colored Title-Bar (generated by the Summary-Sorters), rather than an Entity/Member Signature, then this method will return null.- Returns:
- The parsed detailed HTML explanation for the Summary-Table item chosen by parameter
'rowIndex'.
IMPORTANT: When parameter'rowIndex'is passed a value that is not out of bounds for the'rowEntities'vector, but is a row that contains an orange Title-Bar, in such cases there is no detail-member (no instance ofReflHTML) to return. When a'rowIndex'for a Title-Bar row is passed, this method will return null, gracefully. - Throws:
java.lang.IndexOutOfBoundsException- IfrowIndexis not properly chosen as per the number of rows in the table. If there are'10'rows-items in this table, then therowIndexparameter should be between'0'and'9'.- Code:
- Exact Method Body:
// Look up the "rowIndex" row in the "rowEntities" vector which just contains the list of // rows on this Summary HTML Table. The "ENTITY" is one of the 5 reflected-HTML classes // used by this package (Method, Field, Constructor etc...) ENTITY selectedEntityMember = rowEntities.elementAt(rowIndex); // Some rows contain only title information. In such cases, there is no detail-element // associated with this table-row. It is just a title!! When the user has passed a title // row to parameter 'rowIndex', just return null. if (selectedEntityMember == null) return null; // Use JavaDocHTMLFile.findReflHTML(int, Class) to get the ReflHTML needed. // NOTE: this.tableType.upgraderReflectionClass <==> ENTITY.class return (ReflHTML<ENTITY>) jdhf.findReflHTML (selectedEntityMember.id, this.tableType.upgraderReflectionClass);
-
getRowHTML
public java.util.Vector<HTMLNode> getRowHTML(int rowIndex)
Retrieve theith HTML<TR>(row) fromthisSummary-TableEntity-Member Rows:
If'rowIndex'is pointing to one of the entities / members of the class (such as a Field, Method or Constructor etc...), then the HTML<A ...>Anchor-URLfor thatEntityis returned. The returned HTML-Vectorwill contain everything between the<TR>and the</TR>for that Table-Row.
Title-Bar Rows:
Not every row in a Summary-Table is guaranteed to have an Entity/Member Signature instance. Bear in mind that whenever a user sorts Summary-Table Row's into Categories or Sections, then any & all Section / Category Title-Bar Rows will be present in the Summary-Table HTML.
Title-Bar rows are the horizontal, fading-orange bars that line the Table of Contents (Summary-Tables). These orange-colored banners have a brief, one-sentence description for a small group of methods, fields or constructors.
If parameter'rowIndex'is pointing to a Title-Bar, then the parsed HTML-Vectorfor that Title-Bar is returned.
In all other cases, the entity/member Signature is returned as a result from a call to this method.- Parameters:
rowIndex- The row number to retrieve- Returns:
- All HTML between the
<TR>and the</TR>for one table-summary row. - Throws:
java.lang.IndexOutOfBoundsException- If'rowIndex'is not within the bounds of the list of rows- Code:
- Exact Method Body:
return tableRows.elementAt(rowIndex);
-
getRowEntity
public ENTITY getRowEntity(int rowIndex)
Retrieve theith entity. The returned instance will be one of the six subclasses of classDeclaration, as decided by the type-parameterENTITY.Entity-Member Rows:
If'rowIndex'is pointing to one of the entities / members of the class (such as a Field, Method or Constructor etc...), then the reflected-class for thatMethod,Field,Constructoris returned. If'this'Summary-Table has Generic-TypeSummaryTableHTML<Field>, then the returnedSummaryTableHTMLwill be aFieldclass instance.
Title-Bar Rows:
Not every row in a Summary-Table is guaranteed to have an Entity/Member Signature instance. Bear in mind that whenever a user sorts Summary-Table Row's into Categories or Sections, then any & all Section / Category Title-Bar Rows will be present in the Summary-Table HTML.
Title-Bar rows are the horizontal, fading-orange bars that line the Table of Contents (Summary-Tables). These orange-colored banners have a brief, one-sentence description for a small group of methods, fields or constructors.
If parameter'rowIndex'is pointing to a Title-Bar, then this method shall default and return null!- Parameters:
rowIndex- The entity-number (row-number) to retrieve fromthisSummary-Table.- Returns:
- The refected-information for one Summary-Table row.
Type-ParameterENTITY:
This Class' Type-Parameter'ENTITY'specifies what kind of Summary-Table is being encapsulated by'this'instance. When Java-Doc builds a Web-Page for a class / type, it can create a table for each of up to six different kinds ofEntity'sor members.
The six kinds ofEntity's/ members are:Methods,Fields,Constructors,EnumConstants,AnnotationElemsandNestedTypes. The Generic Type-Parameter'ENTITY'must be equal to exactly one of these six aforementioned classes. - Throws:
java.lang.IndexOutOfBoundsException- If'rowIndex'is not within the bounds of the list of rows- Code:
- Exact Method Body:
return rowEntities.elementAt(rowIndex);
-
getRowEntityAndHTML
public Ret2<ENTITY,java.util.Vector<HTMLNode>> getRowEntityAndHTML (int rowIndex)
Retrieve both the row-HTML and the reflected-entity information for theith row inthisSummary-Table.
Not every row in a Summary-Table is guaranteed to have a Member Signature. When Summary-Table's are sorted into categories or sections, then a Summary-Table may also have a Title-Bar row. It is (hopefully) obvious that a Title-Bar row would not contain an associated'ENTITY'(Method, Field, Constructor, etc...).- Parameters:
rowIndex- The entity-number / row-number to retrieve fromthisSummary-Table.- Returns:
- An instance of
Ret2:-
Ret2.a, of type'ENTITY'(this class sole type-parameter).
If parameter'rowIndex'points to a 'Title-Bar' row, rather than a CIET/Type row, thenRet2.awill contain null. -
Ret2.b, of typeVector<HTMLNode>.
This will usually contain a Member/EntitySignature, as a parsed HTML-Vector. If parameter'rowIndex'is pointing to a Title-Bar Row, then the HTML-Vectorthat's returned will contain the Title-Bar's HTML.
Type-ParameterENTITY:
This Class' Type-Parameter'ENTITY'specifies what kind of Summary-Table is being encapsulated by'this'instance. When Java-Doc builds a Web-Page for a class / type, it can create a table for each of up to six different kinds ofEntity'sor members.
The six kinds ofEntity's/ members are:Methods,Fields,Constructors,EnumConstants,AnnotationElemsandNestedTypes. The Generic Type-Parameter'ENTITY'must be equal to exactly one of these six aforementioned classes. -
- Throws:
java.lang.IndexOutOfBoundsException- If'rowIndex'is not within the bounds of the list of rows- Code:
- Exact Method Body:
return new Ret2<>(rowEntities.elementAt(rowIndex), tableRows.elementAt(rowIndex));
-
getRowDetailAndHTML
public Ret2<ReflHTML<ENTITY>,java.util.Vector<HTMLNode>> getRowDetailAndHTML (int rowIndex)
Retrieve both the row-HTML and and the corresponding / matching instance ofReflHTMLfor theith row inthisSummary-Table
Not every row in a Summary-Table is guaranteed to have a Member Signature. When Summary-Table's are sorted into categories or sections, then a Summary-Table may also have a Title-Bar row. It is (hopefully) obvious that a Title-Bar row would not contain an associated'ReflHTML'HTML Data-Object either.- Parameters:
rowIndex- The entity-number / row-number to retrieve fromthisSummary-Table.- Returns:
- An instance of
Ret2:-
Ret2.a, of typeReflHTML<ENTITY>.
An instance of'ReflHTML'contains the entire parsed-HTML Detail-Element, broken down into it's constituent parts.
If parameter'rowIndex'points to a 'Title-Bar' row, rather than a CIET/Type row, thenRet2.awill contain null. -
Ret2.b, of typeVector<HTMLNode>.
This will usually contain a Member/EntitySignature, as a parsed HTML-Vector. If parameter'rowIndex'is pointing to a Title-Bar Row, then the HTML-Vectorthat's returned will contain the Title-Bar's HTML.
Type-ParameterENTITY:
This Class' Type-Parameter'ENTITY'specifies what kind of Summary-Table is being encapsulated by'this'instance. When Java-Doc builds a Web-Page for a class / type, it can create a table for each of up to six different kinds ofEntity'sor members.
The six kinds ofEntity's/ members are:Methods,Fields,Constructors,EnumConstants,AnnotationElemsandNestedTypes. The Generic Type-Parameter'ENTITY'must be equal to exactly one of these six aforementioned classes. -
- Throws:
java.lang.IndexOutOfBoundsException- Ifiis not within the bounds of the list of rows- See Also:
getRowDetail(int)- Code:
- Exact Method Body:
return new Ret2<>(getRowDetail(rowIndex), tableRows.elementAt(rowIndex));
-
rowHTMLStream
public java.util.stream.Stream<java.util.Vector<HTMLNode>> rowHTMLStream()
AStreamthat containsthisSummary-Table's rows, as Vectorized-HTML- Returns:
- A stream of Vectorized-HTML Table-Rows for
thisSummary-Table.
Note that a JavaStreamis easily converted into just about any necessary data-type, as explained in the table below:Conversion-Target Stream-Method Invocation T[]Stream.toArray(T[]::new); /* Use Actual Class of T, generic array creation is not allowed in Java. */List<T>Stream.collect(Collectors.toList());Vector<T>Stream.collect(Collectors.toCollection(Vector::new));TreeSet<T>Stream.collect(Collectors.toCollection(TreeSet::new));Iterator<T>Stream.iterator(); - Code:
- Exact Method Body:
return tableRows.stream();
-
rowEntityStream
public java.util.stream.Stream<ENTITY> rowEntityStream()
AStreamthat contains all Summary-Table row-entities, as instances of the reflected information classENTITY(this class' sole type-parameter).
Generic Type-ParameterENTITYwill be one of the six concrete subclasses of classDeclaration.- Returns:
- A stream of entities contained by
thisSummary-Table.
Type-ParameterENTITY:
This Class' Type-Parameter'ENTITY'specifies what kind of Summary-Table is being encapsulated by'this'instance. When Java-Doc builds a Web-Page for a class / type, it can create a table for each of up to six different kinds ofEntity'sor members.
The six kinds ofEntity's/ members are:Methods,Fields,Constructors,EnumConstants,AnnotationElemsandNestedTypes. The Generic Type-Parameter'ENTITY'must be equal to exactly one of these six aforementioned classes.
Note that a JavaStreamis easily converted into just about any necessary data-type, as explained in the table below:Conversion-Target Stream-Method Invocation T[]Stream.toArray(T[]::new); /* Use Actual Class of T, generic array creation is not allowed in Java. */List<T>Stream.collect(Collectors.toList());Vector<T>Stream.collect(Collectors.toCollection(Vector::new));TreeSet<T>Stream.collect(Collectors.toCollection(TreeSet::new));Iterator<T>Stream.iterator(); - Code:
- Exact Method Body:
return rowEntities.stream();
-
entityAndHTMLStream
public java.util.stream.Stream<Ret2<ENTITY,java.util.Vector<HTMLNode>>> entityAndHTMLStream ()
Retrieve aStreamthat contains every Summary-Table Row.
The specific contents of thisStreamare instances ofRet2, which contain both the reflected-entity information (instance of Type-ParameterENTITY) and the Vectorized-HTML Table-Row, as well.- Returns:
- A Java Stream containing instances of
Ret2:-
Ret2.a, of type'ENTITY'(this class sole type-parameter).
If parameter'rowIndex'points to a 'Title-Bar' row, rather than a CIET/Type row, thenRet2.awill contain null. -
Ret2.b, of typeVector<HTMLNode>.
This will usually contain a Member/EntitySignature, as a parsed HTML-Vector. If parameter'rowIndex'is pointing to a Title-Bar Row, then the HTML-Vectorthat's returned will contain the Title-Bar's HTML.
Type-ParameterENTITY:
This Class' Type-Parameter'ENTITY'specifies what kind of Summary-Table is being encapsulated by'this'instance. When Java-Doc builds a Web-Page for a class / type, it can create a table for each of up to six different kinds ofEntity'sor members.
The six kinds ofEntity's/ members are:Methods,Fields,Constructors,EnumConstants,AnnotationElemsandNestedTypes. The Generic Type-Parameter'ENTITY'must be equal to exactly one of these six aforementioned classes. -
- Code:
- Exact Method Body:
final Stream.Builder<Ret2<ENTITY, Vector<HTMLNode>>> b = Stream.builder(); for (int rowIndex=0; rowIndex < rowEntities.size(); rowIndex++) b.accept(new Ret2<>(rowEntities.elementAt(rowIndex), tableRows.elementAt(rowIndex))); return b.build();
-
reflAndHTMLStream
public java.util.stream.Stream<Ret2<ReflHTML<ENTITY>,java.util.Vector<HTMLNode>>> reflAndHTMLStream ()
Retrieve the entire list of Table-Rows in this HTML Summary-Table into aVector.- Returns:
- A Java Stream containing instances of
Ret2:-
Ret2.a, of typeReflHTML<ENTITY>.
An instance of'ReflHTML'contains the entire parsed-HTML Detail-Element, broken down into it's constituent parts.
If parameter'rowIndex'points to a 'Title-Bar' row, rather than a CIET/Type row, thenRet2.awill contain null. -
Ret2.b, of typeVector<HTMLNode>.
This will usually contain a Member/EntitySignature, as a parsed HTML-Vector. If parameter'rowIndex'is pointing to a Title-Bar Row, then the HTML-Vectorthat's returned will contain the Title-Bar's HTML.
Type-ParameterENTITY:
This Class' Type-Parameter'ENTITY'specifies what kind of Summary-Table is being encapsulated by'this'instance. When Java-Doc builds a Web-Page for a class / type, it can create a table for each of up to six different kinds ofEntity'sor members.
The six kinds ofEntity's/ members are:Methods,Fields,Constructors,EnumConstants,AnnotationElemsandNestedTypes. The Generic Type-Parameter'ENTITY'must be equal to exactly one of these six aforementioned classes. -
- Code:
- Exact Method Body:
final Stream.Builder<Ret2<ReflHTML<ENTITY>, Vector<HTMLNode>>> b = Stream.builder(); for (int rowIndex=0; rowIndex < rowEntities.size(); rowIndex++) b.accept(new Ret2<>(getRowDetail(rowIndex), tableRows.elementAt(rowIndex))); return b.build();
-
find
public int find(java.lang.String name)
Retrieves the first Entity/Member whose name matchesname. When searching aSummaryTableHTML<Field>,SummaryTableHTML<EnumConstant>orSummaryTableHTML<AnnotationElem>, the name of the entity/member will uniquely identify it amongst the others in the table.
Due to Java's function overloading, there may be many cases where a member'name'is not sufficient to uniquely identify it (for Method's and Constructor's). In such cases (e.g. overloaded methods) this method simply return the index of the first match it finds.- Parameters:
name- The name of the entity / member, as ajava.lang.String- Returns:
- The index of the (first) HTML Table-Row that contains the specified
Entity. If this Summary-Table does not have any member-signatures by that'name', then-1will be returned. - Code:
- Exact Method Body:
ENTITY e = null; for (int i=0; i < rowEntities.size(); i++) // After a sort, all Title-Rows have null Row-Entity elements // Make sure to skip any row completely if it is a Title-Row if ((e = rowEntities.elementAt(i)) != null) if (e.name.equals(name)) return i; return -1;
-
findFirst
public int findFirst(java.lang.String methodOrCtorName)
Retrieves the first Entity/Member whose name matches'methodOrCtorName'.
Callable's Only:
This method should only be invoked onMethodorConstructorSummary Table's (otherwise an exception shall throw).- Parameters:
methodOrCtorName- The name of the callable (method or constructor) for which you are searching. Note that if you are looking for a constructor, thisStringshould be the same as the CIET/Type class-name whose summaries you are searching.- Returns:
- The index of the first HTML Table-Row that matches this specified name. If this
Summary-Table does not have any (Method or Constructor) Member-Signatures by that name,
then
-1is returned. - Code:
- Exact Method Body:
CHECK_IS_CALLABLE(); ENTITY e = null; for (int i=0; i < rowEntities.size(); i++) // After a sort, all Title-Rows have null Row-Entity elements // Make sure to skip any row completely if it is a Title-Row if ((e = rowEntities.elementAt(i)) != null) if (e.name.equals(methodOrCtorName)) return i; return -1;
-
findFirst
public int findFirst(java.lang.String methodOrCtorName, int numParams)
Retrieves the first Entity/Member whose name matches'methodOrCtorName', and accepts'numParams'parameters.
Callable's Only:
This method should only be invoked onMethodorConstructorSummary Table's (otherwise an exception shall throw).- Parameters:
methodOrCtorName- The name of the callable (method or constructor) for which you are searching. Note that if you are looking for a constructor, thisStringshould be the same as the CIET/Type class-name whose summaries you are searching.- Returns:
- The index of the first HTML Table-Row that matches the provided specifications. If
this Summary-Table does not have any Member-Signatures with that name and accepting the
specified number of parameters, then this method returns
-1. - Throws:
java.lang.IllegalArgumentException- If the value passed to the'numParams'parameter is less than '1', then this method will throw an exception.Callable'scannot accept a negative number of arguments, and to find a zero-argumentCallable, the standardfind(String name)method should be used.- Code:
- Exact Method Body:
CHECK_IS_CALLABLE(); CHECK_NUM_PARAMS(numParams); for (int i=0; i < rowEntities.size(); i++) { final ENTITY e = rowEntities.elementAt(i); // After a sort, all Title-Rows have null Row-Entity elements // Make sure to skip any row completely if it is a Title-Row if (e == null) continue; if (e.name.equals(methodOrCtorName)) if (((Callable) e).numParameters() == numParams) return i; } return -1;
-
findAll
public java.util.stream.IntStream findAll (java.lang.String methodOrCtorName)
Retrieves all Entities/Member Table-Row Indices whose name matches'methodOrCtorName'.
Callable's Only:
This method should only be invoked onMethodorConstructorSummary Table's (otherwise an exception shall throw).- Parameters:
methodOrCtorName- The name of the callable (method or constructor) for which you are searching. Note that if you are looking for a constructor, thisStringshould be the same as the CIET/Type class-name whose summaries you are searching.- Returns:
- A Java IntStream of all indices for table-rows that match. If no matches are found, then
the empty-stream is returned.
Remember that a Java Int-Stream is easily & quickly converted to anint[]-Array using the classIntStreammethod'toArray()'.
Example:
int[] tableRows = methodSummTable.findAll("someMethodName").toArray();
- Code:
- Exact Method Body:
CHECK_IS_CALLABLE(); final IntStream.Builder b = IntStream.builder(); ENTITY e = null; for (int i=0; i < rowEntities.size(); i++) // After a sort, all Title-Rows have null Row-Entity elements // Make sure to skip any row completely if it is a Title-Row if ((e = rowEntities.elementAt(i)) != null) if (e.name.equals(methodOrCtorName)) b.accept(i); return b.build();
-
findAll
public java.util.stream.IntStream findAll (java.lang.String methodOrCtorName, int numParams)
Retrieves the first Entity/Member Table-Row Index whose name matches'methodOrCtorName', and accepts'numParams'parameters.
Callable's Only:
This method should only be invoked onMethodorConstructorSummary Table's (otherwise an exception shall throw).- Parameters:
methodOrCtorName- The name of the callable (method or constructor) for which you are searching. Note that if you are looking for a constructor, thisStringshould be the same as the CIET/Type class-name whose summaries you are searching.numParams- This parameter should identify how many params are accepted by theCallable(MethodorConstructor) for which you are searching.
NOTE: If you are attempting to find a zero-argumentMethodorConstructor, the name of thatCallablewould uniquely identify it amongst otherCallable'sof the same name. OnlyCallable'sthat accept at least one parameter can be overloaded!
To find a zero-argumentCallable, please use the method:find(String name). This method will throw anIllegalArgumentExceptionif the value passed to this parameter is less than'1'- Returns:
- A Java IntStream of all indices for table-rows that match. If no matches are found, then
the empty-stream is returned.
Remember that a Java Int-Stream is easily & quickly converted to anint[]-Array using the classIntStreammethod'toArray()'.
Example:
int[] tableRows = methodSummTable.findAll("someMethodName", 1).toArray();
- Throws:
java.lang.IllegalArgumentException- If the value passed to the'numParams'parameter is less than '1', then this method will throw an exception.Callable'scannot accept a negative number of arguments, and to find a zero-argumentCallable, the standardfind(String name)method should be used.- Code:
- Exact Method Body:
CHECK_IS_CALLABLE(); CHECK_NUM_PARAMS(numParams); final IntStream.Builder b = IntStream.builder(); for (int i=0; i < rowEntities.size(); i++) { final ENTITY e = rowEntities.elementAt(i); // After a sort, all Title-Rows have null Row-Entity elements // Make sure to skip any row completely if it is a Title-Row if (e == null) continue; if (e.name.equals(methodOrCtorName)) if (((Callable) e).numParameters() == numParams) b.accept(i); } return b.build();
-
debugPrint
public void debugPrint(java.lang.Appendable a)
Prints an abbreviated-version of the contents of this instance, to a user-providedAppendable. If the HTML requires more than four lines of text, only the first four lines are printed.- Parameters:
a- This may be any Java Appendable. If anIOExceptionis thrown while writing to thisAppendable, it will be caught an wrapped in anIllegalArgumentException, with theIOExceptionset as thecause.- Throws:
java.lang.IllegalArgumentException- If'a'throws anIOException- See Also:
StrPrint.firstNLines(String, int),Util.pageToString(Vector),StrIndent.indent(String, int)- Code:
- Exact Method Body:
try { if (tableType != null) a.append (BCYAN + "this.tableType: " + RESET + this.tableType.toString() + "\n"); else a.append(BRED + "this.tableType is null" + RESET); if (tableOpen != null) a.append (BCYAN + "this.tableOpen: " + RESET + this.tableOpen.n.str + "\n"); else a.append(BRED + "this.tableOpen is null" + RESET); if (tableClose != null) a.append (BCYAN + "this.tableClose: " + RESET + this.tableClose.n.str + "\n"); else a.append(BRED + "this.tableClose is null" + RESET); if (openingCinzelH3 != null) a.append (BCYAN + "this.openingCinzelH3: " + RESET + this.openingCinzelH3.n.str + "\n"); else a.append(BRED + "this.openingCinzelH3 is null" + RESET); if (headerRow != null) a.append( STARS + BCYAN + "this.headerRow:" + RESET + STARS + StrPrint.firstNLines(Util.pageToString(headerRow), 4) + '\n' ); for (int i=0; i < tableRows.size(); i++) a.append( BCYAN + "TABLE ROW " + (i+1) + RESET + '\n' + BGREEN + "HTML:\n" + RESET + StrIndent.indent (Util.pageToString(tableRows.elementAt(i)).replace("\n", "\\n"), 4) + '\n' + BGREEN + "ENTITY:\n" + RESET + StrIndent.indent (rowEntities.elementAt(i).toString(PF.UNIX_COLORS | PF.JOW_INSTEAD), 4) + '\n' ); } catch (java.io.IOException ioe) { throw new IllegalArgumentException( ioe ); }
-
debugPrintDense
public java.lang.String debugPrintDense(int numCharsWide)
A really great way to view the contents of this class - in just one page of text.- Parameters:
numCharsWide- The maximum line width to be printed to terminal. This number must be between 60 and 150, or else an exception shall throw.- Returns:
- The contents of this class-instance, as a
String - Throws:
java.lang.IllegalArgumentException- If the parameter 'numCharsWide' was not passed a value within the aforementioned range.- See Also:
StrPrint.printListAbbrev(Iterable, int, int, boolean, boolean, boolean),StrPrint.printListAbbrev(Iterable, IntTFunction, int, int, boolean, boolean, boolean)- Code:
- Exact Method Body:
if ((numCharsWide < 60) || (numCharsWide > 150)) throw new IllegalArgumentException ("Parameter 'numCharsWide' wasn't passed a value between 60 and 150: " + numCharsWide); return "rowEntities.size(): " + rowEntities.size() + '\n' + "rowEntities Vector Contents:" + // '\n' is automatically added StrPrint.printListAbbrev(rowEntities, numCharsWide, 4, false, true, true) + '\n' + "tableRows.size(): " + tableRows.size() + '\n' + "tableRows Vector Contents:" + // '\n' is automatically added StrPrint.printListAbbrev( tableRows, (int i, Vector<HTMLNode> tableRow) -> Util.pageToString(tableRow), numCharsWide, 4, false, true, true );
-
toString
public java.lang.String toString()
Converts the contents of this class into aString- Overrides:
toStringin classjava.lang.Object- Returns:
- A Printable-
String - See Also:
debugPrintDense(int)- Code:
- Exact Method Body:
final String oStr = (this.tableOpen == null) ? "null" : this.tableOpen.toString(); final String cStr = (this.tableClose == null) ? "null" : this.tableClose.toString(); final String hStr = (this.headerRow == null) ? "null" : StrPrint.abbrevEndRDSF(Util.pageToString(headerRow), 120, false); return "tableType: " + tableType + '\n' + "tableOpen: " + oStr + '\n' + "tableClose: " + cStr + '\n' + "headerRow: " + hStr + '\n' + debugPrintDense(120);
-
-