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
,AnnotationElem
orNestedType
. 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.Consumer
instance) that receives aJavaDocHTMLFile
instance.
ClassJavaDocHTMLFile
provides 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, classJavaDocHTMLFile
has getters for:HeaderFooterHTML
,SummaryTableHTML
andReflHTML
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
,ReflHTML
andHeaderFooterHTML
.
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: 40,378 Bytes Line Count: 926 '\n' Characters Found
-
-
Field Summary
Serializable ID Modifier and Type Field protected static long
serialVersionUID
Summary-Table Type, as the Entity 'enum' Modifier and Type Field Entity
tableType
HTML <TABLE>
and</TABLE>
Tag DefinitionsModifier and Type Field TagNodeIndex
tableClose
TagNodeIndex
tableOpen
-
Constructor Summary
Constructors Constructor Description SummaryTableHTML(Torello.JDUInternal.Parse.HTML.SummaryTable.SummTableRec<ENTITY> summTableRec)
-
Method Summary
Retrieve partial HTML Table-Row <TR> ... </TR>
Data, by Row-IndexModifier and Type Method ReflHTML<ENTITY>
getRowDetail(int rowIndex)
ENTITY
getRowEntity(int rowIndex)
Vector<HTMLNode>
getRowHTML(int rowIndex)
Retrieve all HTML Table-Row <TR> ... </TR>
Data, by Row-IndexModifier and Type Method Ret2<ReflHTML<ENTITY>,
Vector<HTMLNode>>getRowDetailAndHTML(int rowIndex)
Ret2<ENTITY,Vector<HTMLNode>>
getRowEntityAndHTML(int rowIndex)
The Number of HTML Table-Rows & the Kind of Rows present Modifier and Type Method boolean[]
memberRows()
int
numRows()
int
numSignatureRows()
int
numTitleBarRows()
Retrieve a Stream containing part of this Summary-Table's <TR> ... </TR>
Row-DataModifier and Type Method Stream<ENTITY>
rowEntityStream()
Stream<Vector<HTMLNode>>
rowHTMLStream()
Retrieve a Stream containing all of this Summary-Table's <TR> ... </TR>
Row-DataModifier 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 int
find(String name)
Find Table-Row(s) Indices by Name for a Method or Constructor Modifier and Type Method IntStream
findAll(String methodOrCtorName)
IntStream
findAll(String methodOrCtorName, int numParams)
int
findFirst(String methodOrCtorName)
int
findFirst(String methodOrCtorName, int numParams)
Quick Debugging Printer & toString()
Modifier and Type Method void
debugPrint(Appendable a)
String
debugPrintDense(int numCharsWide)
String
toString()
-
-
-
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 theSerializable
Implementation 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
-
tableClose
public final TagNodeIndex tableClose
The closing</TABLE>
tag, for a Summary-Section Table
-
-
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 /Vector
to 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>-URL
link to one of the members of the class (a method, field, constructor, etc...), the returned array will containTRUE
for 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 whoseboolean
values areTRUE
if 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 therowIndex
th instance ofReflHTML
that 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 theReflHTML
for thetoString
Method.
The returnedReflHTML
instance 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
- IfrowIndex
is not properly chosen as per the number of rows in the table. If there are'10'
rows-items in this table, then therowIndex
parameter 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 thei
th HTML<TR>
(row) fromthis
Summary-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-URL
for thatEntity
is returned. The returned HTML-Vector
will 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-Vector
for 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 thei
th 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
,Constructor
is returned. If'this'
Summary-Table has Generic-TypeSummaryTableHTML<Field>
, then the returnedSummaryTableHTML
will be aField
class 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 fromthis
Summary-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's
or members.
The six kinds ofEntity's
/ members are:Methods
,Fields
,Constructors
,EnumConstants
,AnnotationElems
andNestedTypes
. 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 thei
th row inthis
Summary-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 fromthis
Summary-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.a
will contain null. -
Ret2.b
, of typeVector<HTMLNode>
.
This will usually contain a Member/Entity
Signature, as a parsed HTML-Vector
. If parameter'rowIndex'
is pointing to a Title-Bar Row, then the HTML-Vector
that'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's
or members.
The six kinds ofEntity's
/ members are:Methods
,Fields
,Constructors
,EnumConstants
,AnnotationElems
andNestedTypes
. 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 ofReflHTML
for thei
th row inthis
Summary-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 fromthis
Summary-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.a
will contain null. -
Ret2.b
, of typeVector<HTMLNode>
.
This will usually contain a Member/Entity
Signature, as a parsed HTML-Vector
. If parameter'rowIndex'
is pointing to a Title-Bar Row, then the HTML-Vector
that'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's
or members.
The six kinds ofEntity's
/ members are:Methods
,Fields
,Constructors
,EnumConstants
,AnnotationElems
andNestedTypes
. The Generic Type-Parameter'ENTITY'
must be equal to exactly one of these six aforementioned classes. -
- Throws:
java.lang.IndexOutOfBoundsException
- Ifi
is 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()
AStream
that containsthis
Summary-Table's rows, as Vectorized-HTML- Returns:
- A stream of Vectorized-HTML Table-Rows for
this
Summary-Table.
Note that a JavaStream
is 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()
AStream
that contains all Summary-Table row-entities, as instances of the reflected information classENTITY
(this class' sole type-parameter).
Generic Type-ParameterENTITY
will be one of the six concrete subclasses of classDeclaration
.- Returns:
- A stream of entities contained by
this
Summary-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's
or members.
The six kinds ofEntity's
/ members are:Methods
,Fields
,Constructors
,EnumConstants
,AnnotationElems
andNestedTypes
. The Generic Type-Parameter'ENTITY'
must be equal to exactly one of these six aforementioned classes.
Note that a JavaStream
is 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 aStream
that contains every Summary-Table Row.
The specific contents of thisStream
are 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.a
will contain null. -
Ret2.b
, of typeVector<HTMLNode>
.
This will usually contain a Member/Entity
Signature, as a parsed HTML-Vector
. If parameter'rowIndex'
is pointing to a Title-Bar Row, then the HTML-Vector
that'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's
or members.
The six kinds ofEntity's
/ members are:Methods
,Fields
,Constructors
,EnumConstants
,AnnotationElems
andNestedTypes
. 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.a
will contain null. -
Ret2.b
, of typeVector<HTMLNode>
.
This will usually contain a Member/Entity
Signature, as a parsed HTML-Vector
. If parameter'rowIndex'
is pointing to a Title-Bar Row, then the HTML-Vector
that'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's
or members.
The six kinds ofEntity's
/ members are:Methods
,Fields
,Constructors
,EnumConstants
,AnnotationElems
andNestedTypes
. 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-1
will 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 onMethod
orConstructor
Summary 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, thisString
should 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
-1
is returned. - Throws:
SummaryTableException
- This method should only be invoked onSummaryTableHTML
instances that haveCallable's
(Method
orConstructor
) as their table-type. If it is invoked on aSummaryTableHTML<Field>
, for instance, then this exception would throw.- 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 onMethod
orConstructor
Summary 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, thisString
should 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:
SummaryTableException
- This method should only be invoked onSummaryTableHTML
instances that haveCallable's
(Method
orConstructor
) as their table-type. If it is invoked on aSummaryTableHTML<Field>
, for instance, then this exception would throw.java.lang.IllegalArgumentException
- If the value passed to the'numParams'
parameter is less than '1', then this method will throw an exception.Callable's
cannot 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 onMethod
orConstructor
Summary 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, thisString
should 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 classIntStream
method'toArray()'
.
Example:
int[] tableRows = methodSummTable.findAll("someMethodName").toArray();
- Throws:
SummaryTableException
- This method should only be invoked onSummaryTableHTML
instances that haveCallable's
(Method
orConstructor
) as their table-type. If it is invoked on aSummaryTableHTML<Field>
, for instance, then this exception would throw.- 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 onMethod
orConstructor
Summary 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, thisString
should 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
(Method
orConstructor
) for which you are searching.
NOTE: If you are attempting to find a zero-argumentMethod
orConstructor
, the name of thatCallable
would uniquely identify it amongst otherCallable's
of the same name. OnlyCallable's
that accept at least one parameter can be overloaded!
To find a zero-argumentCallable
, please use the method:find(String name)
. This method will throw anIllegalArgumentException
if 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 classIntStream
method'toArray()'
.
Example:
int[] tableRows = methodSummTable.findAll("someMethodName", 1).toArray();
- Throws:
SummaryTableException
- This method should only be invoked onSummaryTableHTML
instances that haveCallable's
(Method
orConstructor
) as their table-type. If it is invoked on aSummaryTableHTML<Field>
, for instance, then this exception would throw.java.lang.IllegalArgumentException
- If the value passed to the'numParams'
parameter is less than '1', then this method will throw an exception.Callable's
cannot 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 anIOException
is thrown while writing to thisAppendable
, it will be caught an wrapped in anIllegalArgumentException
, with theIOException
set 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 (cinzelH3 != null) a.append (BCYAN + "this.cinzelH3: " + RESET + this.cinzelH3.n.str + "\n"); else a.append(BRED + "this.cinzelH3 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:
toString
in 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);
-
-