Package Torello.HTML
Class Debug
- java.lang.Object
-
- Torello.HTML.Debug
-
public class Debug extends java.lang.Object
A fast way to print Web-PageVector's
to aString
.
Debugging code that is written to modify or delete nodes in HTML is usually easy, until you misstep a node with an "off-by-one" error, or honest-but-poorly-placed break/continue statement in a loop. These methods make printing the contents of a Vector or sublist quick and easy.This class has many
Note that it is always easiest to use:'toString()'
methods for printing Vectorized-HTMLUtil.pageToString
, orUtil.rangeToString
for printing anyVector<HTMLNode>
.
Sublte Reminder:
The classUtil
already has a'pageToString'
and'rangeToString'
method-group, which should usually be sufficient for debugging. Sometimes, though, the extra information that is printed by the debug-print methods in this class will help identify when aTextNode
in your vectorized-html does not actually contain the text that the web-page in your browser is rendering.
IMPORTANT:
After some amount of debate, it seems easier to leave off another "English Word / English Language" description of what each of the methods in this class shall print. Instead, I will display sample UNIX Terminal Output that is generated using identical input to each of these methods.
If the text output is not enough to explain, precisely, (in your mind) what the actual data that you are looking at is - please, you may also scroll down to the methods section on this page, to view the "character-by-character" code-explanation of what these debug methods are actually printing, precisely.
The node classes in this HTML package are extremely light - they do not store many internal fields at all. In fact, onlyclass HTML.TagNode
even contains specialized extra internal fields.View the Different HTML Print Styles:
Sample Input HTML:
public static final String html = "<!-- This Content was copied from a Random Internet Photo Bomb Site. Practice Makes Perfect. -->" + "<h2>Dorothy Parker</h2>\n" + "<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/parker-1024x784.jpg'>\n" + "<p>Parker was a very important screenwriter in the 1930s and 40s.<strong>She wrote some incredible screenplays for Alfred Hitchcock but was accused of having ties to Communism</strong>, which destroyed her career pretty much instantly. In 1949, Parker received a 1,000-word letter, acknowledging her blacklisting for reasons tied to suspicion.</p>\n" + "<h2>Vince Vaughn</h2>\n" + "<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/7-11.jpg'>\n" + "<p>Vince Vaughn was torn down for reasons outside of his personal sphere.<strong>Vaughn’s downfall came from his inability to vary his acting techniques</strong>. Vaughn played the same character in every movie that he was in, he was never quite able to dump his goofy persona, even when acting in dramas. This is evident by his terrible season on True Detective.</p>\n" + "<!-- Programmers Note: Jim Caviezel plays 'The Man in the Suit' in TV show 'Person of Interest'. -->" + "<h2>Jim Caviezel</h2>\n" + "<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/8-9-1024x576.jpg'>\n" + "<p>Caviezel was best known for his role as Jesus in The Passion of the Christ, directed by Mel Gibson. The movie made a bunch of money and received critical acclaim, but<strong>the overdramatization and hyper-violent imagery was met with backlash from the community.</strong>Caviezel has had a few small roles since The Passion of the Christ, but he has yet to be offered a full role in a film since.</p>\n";
Print Style A
Standard Text, No New-Lines Added, Data Class Names Printed
[CommentNode:<!-- This Content was copied from a Random Internet Photo Bomb Site. Practice Makes Perfect. -->][TagNode:<h2>][TextNode:Dorothy Parker][TagNode:</h2>][TextNode: ][TagNode:<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/parker-1024x784.jpg'>][TextNode: ][TagNode:<p>][TextNode:Parker was a very important screenwriter in the 1930s and 40s.][TagNode:<strong>][TextNode:She wrote some incredible screenplays for Alfred Hitchcock but was accused of having ties to Communism][TagNode:</strong>][TextNode:, which destroyed her career pretty much instantly. In 1949, Parker received a 1,000-word letter, acknowledging her blacklisting for reasons tied to suspicion.][TagNode:</p>][TextNode: ][TagNode:<h2>][TextNode:Vince Vaughn][TagNode:</h2>][TextNode: ][TagNode:<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/7-11.jpg'>][TextNode: ][TagNode:<p>][TextNode:Vince Vaughn was torn down for reasons outside of his personal sphere.][TagNode:<strong>][TextNode:Vaughn’s downfall came from his inability to vary his acting techniques][TagNode:</strong>][TextNode:. Vaughn played the same character in every movie that he was in, he was never quite able to dump his goofy persona, even when acting in dramas. This is evident by his terrible season on True Detective.][TagNode:</p>][TextNode: ][CommentNode:<!-- Programmers Note: Jim Caviezel plays 'The Man in the Suit' in TV show 'Person of Interest'. -->][TagNode:<h2>][TextNode:Jim Caviezel][TagNode:</h2>][TextNode: ][TagNode:<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/8-9-1024x576.jpg'>][TextNode: ][TagNode:<p>][TextNode:Caviezel was best known for his role as Jesus in The Passion of the Christ, directed by Mel Gibson. The movie made a bunch of money and received critical acclaim, but][TagNode:<strong>][TextNode:the overdramatization and hyper-violent imagery was met with backlash from the community.][TagNode:</strong>][TextNode:Caviezel has had a few small roles since The Passion of the Christ, but he has yet to be offered a full role in a film since.][TagNode:</p>][TextNode: ]
Print Style B
Standard Text, No New-Lines Added, Data Class Names, Node-String Length Printed
[CommentNode, StrLen=97: <!-- This Content was copied from a Random Internet Photo Bomb Site. Practice Makes Perfect. -->][TagNode, StrLen=4: <h2>][TextNode, StrLen=14: Dorothy Parker][TagNode, StrLen=5: </h2>][TextNode, StrLen=1: ][TagNode, StrLen=93: <img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/parker-1024x784.jpg'>][TextNode, StrLen=1: ][TagNode, StrLen=3: <p>][TextNode, StrLen=62: Parker was a very important screenwriter in the 1930s and 40s.][TagNode, StrLen=8: <strong>][TextNode, StrLen=102: She wrote some incredible screenplays for Alfred Hitchcock but was accused of having ties to Communism][TagNode, StrLen=9: </strong>][TextNode, StrLen=159: , which destroyed her career pretty much instantly. In 1949, Parker received a 1,000-word letter, acknowledging her blacklisting for reasons tied to suspicion.][TagNode, StrLen=4: </p>][TextNode, StrLen=1: ][TagNode, StrLen=4: <h2>][TextNode, StrLen=12: Vince Vaughn][TagNode, StrLen=5: </h2>][TextNode, StrLen=1: ][TagNode, StrLen=82: <img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/7-11.jpg'>][TextNode, StrLen=1: ][TagNode, StrLen=3: <p>][TextNode, StrLen=70: Vince Vaughn was torn down for reasons outside of his personal sphere.][TagNode, StrLen=8: <strong>][TextNode, StrLen=77: Vaughn’s downfall came from his inability to vary his acting techniques][TagNode, StrLen=9: </strong>][TextNode, StrLen=202: . Vaughn played the same character in every movie that he was in, he was never quite able to dump his goofy persona, even when acting in dramas. This is evident by his terrible season on True Detective.][TagNode, StrLen=4: </p>][TextNode, StrLen=1: ][CommentNode, StrLen=100: <!-- Programmers Note: Jim Caviezel plays 'The Man in the Suit' in TV show 'Person of Interest'. -->][TagNode, StrLen=4: <h2>][TextNode, StrLen=12: Jim Caviezel][TagNode, StrLen=5: </h2>][TextNode, StrLen=1: ][TagNode, StrLen=90: <img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/8-9-1024x576.jpg'>][TextNode, StrLen=1: ][TagNode, StrLen=3: <p>][TextNode, StrLen=166: Caviezel was best known for his role as Jesus in The Passion of the Christ, directed by Mel Gibson. The movie made a bunch of money and received critical acclaim, but][TagNode, StrLen=8: <strong>][TextNode, StrLen=89: the overdramatization and hyper-violent imagery was met with backlash from the community.][TagNode, StrLen=9: </strong>][TextNode, StrLen=125: Caviezel has had a few small roles since The Passion of the Christ, but he has yet to be offered a full role in a film since.][TagNode, StrLen=4: </p>][TextNode, StrLen=1: ]
Print Style C
Standard Text, No New-Lines, Class Names, Instances of TagNode Have More Info Printed
[CommentNode: <!-- This Content was copied from a Random Internet Photo Bomb Site. Practice Makes Perfect. -->][TagNode, n.tok=h2, n.isClosing=false: <h2>][TextNode: Dorothy Parker][TagNode, n.tok=h2, n.isClosing=true: </h2>][TextNode: ][TagNode, n.tok=img, n.isClosing=false: <img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/parker-1024x784.jpg'>][TextNode: ][TagNode, n.tok=p, n.isClosing=false: <p>][TextNode: Parker was a very important screenwriter in the 1930s and 40s.][TagNode, n.tok=strong, n.isClosing=false: <strong>][TextNode: She wrote some incredible screenplays for Alfred Hitchcock but was accused of having ties to Communism][TagNode, n.tok=strong, n.isClosing=true: </strong>][TextNode: , which destroyed her career pretty much instantly. In 1949, Parker received a 1,000-word letter, acknowledging her blacklisting for reasons tied to suspicion.][TagNode, n.tok=p, n.isClosing=true: </p>][TextNode: ][TagNode, n.tok=h2, n.isClosing=false: <h2>][TextNode: Vince Vaughn][TagNode, n.tok=h2, n.isClosing=true: </h2>][TextNode: ][TagNode, n.tok=img, n.isClosing=false: <img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/7-11.jpg'>][TextNode: ][TagNode, n.tok=p, n.isClosing=false: <p>][TextNode: Vince Vaughn was torn down for reasons outside of his personal sphere.][TagNode, n.tok=strong, n.isClosing=false: <strong>][TextNode: Vaughn’s downfall came from his inability to vary his acting techniques][TagNode, n.tok=strong, n.isClosing=true: </strong>][TextNode: . Vaughn played the same character in every movie that he was in, he was never quite able to dump his goofy persona, even when acting in dramas. This is evident by his terrible season on True Detective.][TagNode, n.tok=p, n.isClosing=true: </p>][TextNode: ][CommentNode: <!-- Programmers Note: Jim Caviezel plays 'The Man in the Suit' in TV show 'Person of Interest'. -->][TagNode, n.tok=h2, n.isClosing=false: <h2>][TextNode: Jim Caviezel][TagNode, n.tok=h2, n.isClosing=true: </h2>][TextNode: ][TagNode, n.tok=img, n.isClosing=false: <img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/8-9-1024x576.jpg'>][TextNode: ][TagNode, n.tok=p, n.isClosing=false: <p>][TextNode: Caviezel was best known for his role as Jesus in The Passion of the Christ, directed by Mel Gibson. The movie made a bunch of money and received critical acclaim, but][TagNode, n.tok=strong, n.isClosing=false: <strong>][TextNode: the overdramatization and hyper-violent imagery was met with backlash from the community.][TagNode, n.tok=strong, n.isClosing=true: </strong>][TextNode: Caviezel has had a few small roles since The Passion of the Christ, but he has yet to be offered a full role in a film since.][TagNode, n.tok=p, n.isClosing=true: </p>][TextNode: ]
Print Style D
Standard Text, No New-Lines, Class Names, TagNode's more information, String Lengths Printed
[CommentNode, StrLen=97: <!-- This Content was copied from a Random Internet Photo Bomb Site. Practice Makes Perfect. -->][TagNode, StrLen=4, n.tok=h2, n.isClosing=false: <h2>][TextNode, StrLen=14: Dorothy Parker][TagNode, StrLen=5, n.tok=h2, n.isClosing=true: </h2>][TextNode, StrLen=1: ][TagNode, StrLen=93, n.tok=img, n.isClosing=false: <img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/parker-1024x784.jpg'>][TextNode, StrLen=1: ][TagNode, StrLen=3, n.tok=p, n.isClosing=false: <p>][TextNode, StrLen=62: Parker was a very important screenwriter in the 1930s and 40s.][TagNode, StrLen=8, n.tok=strong, n.isClosing=false: <strong>][TextNode, StrLen=102: She wrote some incredible screenplays for Alfred Hitchcock but was accused of having ties to Communism][TagNode, StrLen=9, n.tok=strong, n.isClosing=true: </strong>][TextNode, StrLen=159: , which destroyed her career pretty much instantly. In 1949, Parker received a 1,000-word letter, acknowledging her blacklisting for reasons tied to suspicion.][TagNode, StrLen=4, n.tok=p, n.isClosing=true: </p>][TextNode, StrLen=1: ][TagNode, StrLen=4, n.tok=h2, n.isClosing=false: <h2>][TextNode, StrLen=12: Vince Vaughn][TagNode, StrLen=5, n.tok=h2, n.isClosing=true: </h2>][TextNode, StrLen=1: ][TagNode, StrLen=82, n.tok=img, n.isClosing=false: <img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/7-11.jpg'>][TextNode, StrLen=1: ][TagNode, StrLen=3, n.tok=p, n.isClosing=false: <p>][TextNode, StrLen=70: Vince Vaughn was torn down for reasons outside of his personal sphere.][TagNode, StrLen=8, n.tok=strong, n.isClosing=false: <strong>][TextNode, StrLen=77: Vaughn’s downfall came from his inability to vary his acting techniques][TagNode, StrLen=9, n.tok=strong, n.isClosing=true: </strong>][TextNode, StrLen=202: . Vaughn played the same character in every movie that he was in, he was never quite able to dump his goofy persona, even when acting in dramas. This is evident by his terrible season on True Detective.][TagNode, StrLen=4, n.tok=p, n.isClosing=true: </p>][TextNode, StrLen=1: ][CommentNode, StrLen=100: <!-- Programmers Note: Jim Caviezel plays 'The Man in the Suit' in TV show 'Person of Interest'. -->][TagNode, StrLen=4, n.tok=h2, n.isClosing=false: <h2>][TextNode, StrLen=12: Jim Caviezel][TagNode, StrLen=5, n.tok=h2, n.isClosing=true: </h2>][TextNode, StrLen=1: ][TagNode, StrLen=90, n.tok=img, n.isClosing=false: <img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/8-9-1024x576.jpg'>][TextNode, StrLen=1: ][TagNode, StrLen=3, n.tok=p, n.isClosing=false: <p>][TextNode, StrLen=166: Caviezel was best known for his role as Jesus in The Passion of the Christ, directed by Mel Gibson. The movie made a bunch of money and received critical acclaim, but][TagNode, StrLen=8, n.tok=strong, n.isClosing=false: <strong>][TextNode, StrLen=89: the overdramatization and hyper-violent imagery was met with backlash from the community.][TagNode, StrLen=9, n.tok=strong, n.isClosing=true: </strong>][TextNode, StrLen=125: Caviezel has had a few small roles since The Passion of the Christ, but he has yet to be offered a full role in a film since.][TagNode, StrLen=4, n.tok=p, n.isClosing=true: </p>][TextNode, StrLen=1: ]
Print Style E
Standard Text, New-Lines Added After each Node (longer-text), Class Names, TagNode information, String Lengths
[CommentNode, StrLen=97] [<!-- This Content was copied from a Random Internet Photo Bomb Site. Practice Makes Perfect. -->] [TagNode, StrLen=4, n.tok=h2, n.isClosing=false] [<h2>] [TextNode, StrLen=14] [Dorothy Parker] [TagNode, StrLen=5, n.tok=h2, n.isClosing=true] [</h2>] [TextNode, StrLen=1] [ ] [TagNode, StrLen=93, n.tok=img, n.isClosing=false] [<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/parker-1024x784.jpg'>] [TextNode, StrLen=1] [ ] [TagNode, StrLen=3, n.tok=p, n.isClosing=false] [<p>] [TextNode, StrLen=62] [Parker was a very important screenwriter in the 1930s and 40s.] [TagNode, StrLen=8, n.tok=strong, n.isClosing=false] [<strong>] [TextNode, StrLen=102] [She wrote some incredible screenplays for Alfred Hitchcock but was accused of having ties to Communism] [TagNode, StrLen=9, n.tok=strong, n.isClosing=true] [</strong>] [TextNode, StrLen=159] [, which destroyed her career pretty much instantly. In 1949, Parker received a 1,000-word letter, acknowledging her blacklisting for reasons tied to suspicion.] [TagNode, StrLen=4, n.tok=p, n.isClosing=true] [</p>] [TextNode, StrLen=1] [ ] [TagNode, StrLen=4, n.tok=h2, n.isClosing=false] [<h2>] [TextNode, StrLen=12] [Vince Vaughn] [TagNode, StrLen=5, n.tok=h2, n.isClosing=true] [</h2>] [TextNode, StrLen=1] [ ] [TagNode, StrLen=82, n.tok=img, n.isClosing=false] [<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/7-11.jpg'>] [TextNode, StrLen=1] [ ] [TagNode, StrLen=3, n.tok=p, n.isClosing=false] [<p>] [TextNode, StrLen=70] [Vince Vaughn was torn down for reasons outside of his personal sphere.] [TagNode, StrLen=8, n.tok=strong, n.isClosing=false] [<strong>] [TextNode, StrLen=77] [Vaughn’s downfall came from his inability to vary his acting techniques] [TagNode, StrLen=9, n.tok=strong, n.isClosing=true] [</strong>] [TextNode, StrLen=202] [. Vaughn played the same character in every movie that he was in, he was never quite able to dump his goofy persona, even when acting in dramas. This is evident by his terrible season on True Detective.] [TagNode, StrLen=4, n.tok=p, n.isClosing=true] [</p>] [TextNode, StrLen=1] [ ] [CommentNode, StrLen=100] [<!-- Programmers Note: Jim Caviezel plays 'The Man in the Suit' in TV show 'Person of Interest'. -->] [TagNode, StrLen=4, n.tok=h2, n.isClosing=false] [<h2>] [TextNode, StrLen=12] [Jim Caviezel] [TagNode, StrLen=5, n.tok=h2, n.isClosing=true] [</h2>] [TextNode, StrLen=1] [ ] [TagNode, StrLen=90, n.tok=img, n.isClosing=false] [<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/8-9-1024x576.jpg'>] [TextNode, StrLen=1] [ ] [TagNode, StrLen=3, n.tok=p, n.isClosing=false] [<p>] [TextNode, StrLen=166] [Caviezel was best known for his role as Jesus in The Passion of the Christ, directed by Mel Gibson. The movie made a bunch of money and received critical acclaim, but] [TagNode, StrLen=8, n.tok=strong, n.isClosing=false] [<strong>] [TextNode, StrLen=89] [the overdramatization and hyper-violent imagery was met with backlash from the community.] [TagNode, StrLen=9, n.tok=strong, n.isClosing=true] [</strong>] [TextNode, StrLen=125] [Caviezel has had a few small roles since The Passion of the Christ, but he has yet to be offered a full role in a film since.] [TagNode, StrLen=4, n.tok=p, n.isClosing=true] [</p>] [TextNode, StrLen=1] [ ]
Print Style F
Standard Text, New-Lines Added (longer text), Class Names, TagNode.toStringAV() invoked on All TagNode, String Lengths
[CommentNode, StrLen=97] [<!-- This Content was copied from a Random Internet Photo Bomb Site. Practice Makes Perfect. -->] TagNode.str: [<h2>], TagNode.tok: [h2], TagNode.isClosing: [false] CONTAINS a total of (0) attributes / inner-tag key-value pairs: [TextNode, StrLen=14] [Dorothy Parker] [TagNode, StrLen=5] [</h2>] [TextNode, StrLen=1] [ ] TagNode.str: [<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/parker-1024x784.jpg'>], TagNode.tok: [img], TagNode.isClosing: [false] CONTAINS a total of (2) attributes / inner-tag key-value pairs: (KEY, VALUE): [width], [750] (KEY, VALUE): [src], [https://upbeatnews.com/wp-content/uploads/2019/08/parker-1024x784.jpg] [TextNode, StrLen=1] [ ] TagNode.str: [<p>], TagNode.tok: [p], TagNode.isClosing: [false] CONTAINS a total of (0) attributes / inner-tag key-value pairs: [TextNode, StrLen=62] [Parker was a very important screenwriter in the 1930s and 40s.] TagNode.str: [<strong>], TagNode.tok: [strong], TagNode.isClosing: [false] CONTAINS a total of (0) attributes / inner-tag key-value pairs: [TextNode, StrLen=102] [She wrote some incredible screenplays for Alfred Hitchcock but was accused of having ties to Communism] [TagNode, StrLen=9] [</strong>] [TextNode, StrLen=159] [, which destroyed her career pretty much instantly. In 1949, Parker received a 1,000-word letter, acknowledging her blacklisting for reasons tied to suspicion.] [TagNode, StrLen=4] [</p>] [TextNode, StrLen=1] [ ] TagNode.str: [<h2>], TagNode.tok: [h2], TagNode.isClosing: [false] CONTAINS a total of (0) attributes / inner-tag key-value pairs: [TextNode, StrLen=12] [Vince Vaughn] [TagNode, StrLen=5] [</h2>] [TextNode, StrLen=1] [ ] TagNode.str: [<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/7-11.jpg'>], TagNode.tok: [img], TagNode.isClosing: [false] CONTAINS a total of (2) attributes / inner-tag key-value pairs: (KEY, VALUE): [width], [750] (KEY, VALUE): [src], [https://upbeatnews.com/wp-content/uploads/2019/08/7-11.jpg] [TextNode, StrLen=1] [ ] TagNode.str: [<p>], TagNode.tok: [p], TagNode.isClosing: [false] CONTAINS a total of (0) attributes / inner-tag key-value pairs: [TextNode, StrLen=70] [Vince Vaughn was torn down for reasons outside of his personal sphere.] TagNode.str: [<strong>], TagNode.tok: [strong], TagNode.isClosing: [false] CONTAINS a total of (0) attributes / inner-tag key-value pairs: [TextNode, StrLen=77] [Vaughn’s downfall came from his inability to vary his acting techniques] [TagNode, StrLen=9] [</strong>] [TextNode, StrLen=202] [. Vaughn played the same character in every movie that he was in, he was never quite able to dump his goofy persona, even when acting in dramas. This is evident by his terrible season on True Detective.] [TagNode, StrLen=4] [</p>] [TextNode, StrLen=1] [ ] [CommentNode, StrLen=100] [<!-- Programmers Note: Jim Caviezel plays 'The Man in the Suit' in TV show 'Person of Interest'. -->] TagNode.str: [<h2>], TagNode.tok: [h2], TagNode.isClosing: [false] CONTAINS a total of (0) attributes / inner-tag key-value pairs: [TextNode, StrLen=12] [Jim Caviezel] [TagNode, StrLen=5] [</h2>] [TextNode, StrLen=1] [ ] TagNode.str: [<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/8-9-1024x576.jpg'>], TagNode.tok: [img], TagNode.isClosing: [false] CONTAINS a total of (2) attributes / inner-tag key-value pairs: (KEY, VALUE): [width], [750] (KEY, VALUE): [src], [https://upbeatnews.com/wp-content/uploads/2019/08/8-9-1024x576.jpg] [TextNode, StrLen=1] [ ] TagNode.str: [<p>], TagNode.tok: [p], TagNode.isClosing: [false] CONTAINS a total of (0) attributes / inner-tag key-value pairs: [TextNode, StrLen=166] [Caviezel was best known for his role as Jesus in The Passion of the Christ, directed by Mel Gibson. The movie made a bunch of money and received critical acclaim, but] TagNode.str: [<strong>], TagNode.tok: [strong], TagNode.isClosing: [false] CONTAINS a total of (0) attributes / inner-tag key-value pairs: [TextNode, StrLen=89] [the overdramatization and hyper-violent imagery was met with backlash from the community.] [TagNode, StrLen=9] [</strong>] [TextNode, StrLen=125] [Caviezel has had a few small roles since The Passion of the Christ, but he has yet to be offered a full role in a film since.] [TagNode, StrLen=4] [</p>] [TextNode, StrLen=1] [ ]
Print Style G
Standard Text, New-Lines Added, Class Names, TagNode.toStringAV() invoked - Except with Zero-Attribute TagNode's, String Lengths Printed
[CommentNode, StrLen=97: <!-- This Content was copied from a Random Internet Photo Bomb Site. Practice Makes Perfect. -->][TagNode, StrLen=4: <h2>][TextNode, StrLen=14: Dorothy Parker][TagNode, StrLen=5: </h2>][TextNode, StrLen=1: ] TagNode.str: [<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/parker-1024x784.jpg'>], TagNode.tok: [img], TagNode.isClosing: [false] CONTAINS a total of (2) attributes / inner-tag key-value pairs: (KEY, VALUE): [width], [750] (KEY, VALUE): [src], [https://upbeatnews.com/wp-content/uploads/2019/08/parker-1024x784.jpg] [TextNode, StrLen=1: ][TagNode, StrLen=3: <p>][TextNode, StrLen=62: Parker was a very important screenwriter in the 1930s and 40s.][TagNode, StrLen=8: <strong>][TextNode, StrLen=102: She wrote some incredible screenplays for Alfred Hitchcock but was accused of having ties to Communism][TagNode, StrLen=9: </strong>][TextNode, StrLen=159: , which destroyed her career pretty much instantly. In 1949, Parker received a 1,000-word letter, acknowledging her blacklisting for reasons tied to suspicion.][TagNode, StrLen=4: </p>][TextNode, StrLen=1: ][TagNode, StrLen=4: <h2>][TextNode, StrLen=12: Vince Vaughn][TagNode, StrLen=5: </h2>][TextNode, StrLen=1: ] TagNode.str: [<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/7-11.jpg'>], TagNode.tok: [img], TagNode.isClosing: [false] CONTAINS a total of (2) attributes / inner-tag key-value pairs: (KEY, VALUE): [width], [750] (KEY, VALUE): [src], [https://upbeatnews.com/wp-content/uploads/2019/08/7-11.jpg] [TextNode, StrLen=1: ][TagNode, StrLen=3: <p>][TextNode, StrLen=70: Vince Vaughn was torn down for reasons outside of his personal sphere.][TagNode, StrLen=8: <strong>][TextNode, StrLen=77: Vaughn’s downfall came from his inability to vary his acting techniques][TagNode, StrLen=9: </strong>][TextNode, StrLen=202: . Vaughn played the same character in every movie that he was in, he was never quite able to dump his goofy persona, even when acting in dramas. This is evident by his terrible season on True Detective.][TagNode, StrLen=4: </p>][TextNode, StrLen=1: ][CommentNode, StrLen=100: <!-- Programmers Note: Jim Caviezel plays 'The Man in the Suit' in TV show 'Person of Interest'. -->][TagNode, StrLen=4: <h2>][TextNode, StrLen=12: Jim Caviezel][TagNode, StrLen=5: </h2>][TextNode, StrLen=1: ] TagNode.str: [<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/8-9-1024x576.jpg'>], TagNode.tok: [img], TagNode.isClosing: [false] CONTAINS a total of (2) attributes / inner-tag key-value pairs: (KEY, VALUE): [width], [750] (KEY, VALUE): [src], [https://upbeatnews.com/wp-content/uploads/2019/08/8-9-1024x576.jpg] [TextNode, StrLen=1: ][TagNode, StrLen=3: <p>][TextNode, StrLen=166: Caviezel was best known for his role as Jesus in The Passion of the Christ, directed by Mel Gibson. The movie made a bunch of money and received critical acclaim, but][TagNode, StrLen=8: <strong>][TextNode, StrLen=89: the overdramatization and hyper-violent imagery was met with backlash from the community.][TagNode, StrLen=9: </strong>][TextNode, StrLen=125: Caviezel has had a few small roles since The Passion of the Christ, but he has yet to be offered a full role in a film since.][TagNode, StrLen=4: </p>][TextNode, StrLen=1: ]
Print Style H (with UNIX Color-Codes)
UNIX Color-Coded Text, No New-Lines Added (shorter text), Class Names, TagNode Information Printed, String Lengths
[CommentNode, StrLen=97: <!-- This Content was copied from a Random Internet Photo Bomb Site. Practice Makes Perfect. -->][TagNode, StrLen=4, n.tok=h2, n.isClosing=false][<h2>][TextNode, StrLen=14: Dorothy Parker][TagNode, StrLen=5, n.tok=h2, n.isClosing=true][</h2>][TextNode, StrLen=1:
][TagNode, StrLen=93, n.tok=img, n.isClosing=false][<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/parker-1024x784.jpg'>][TextNode, StrLen=1:
][TagNode, StrLen=3, n.tok=p, n.isClosing=false][<p>][TextNode, StrLen=62: Parker was a very important screenwriter in the 1930s and 40s.][TagNode, StrLen=8, n.tok=strong, n.isClosing=false][<strong>][TextNode, StrLen=102: She wrote some incredible screenplays for Alfred Hitchcock but was accused of having ties to Communism][TagNode, StrLen=9, n.tok=strong, n.isClosing=true][</strong>][TextNode, StrLen=159: , which destroyed her career pretty much instantly. In 1949, Parker received a 1,000-word letter, acknowledging her blacklisting for reasons tied to suspicion.][TagNode, StrLen=4, n.tok=p, n.isClosing=true][</p>][TextNode, StrLen=1:
][TagNode, StrLen=4, n.tok=h2, n.isClosing=false][<h2>][TextNode, StrLen=12: Vince Vaughn][TagNode, StrLen=5, n.tok=h2, n.isClosing=true][</h2>][TextNode, StrLen=1:
][TagNode, StrLen=82, n.tok=img, n.isClosing=false][<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/7-11.jpg'>][TextNode, StrLen=1:
][TagNode, StrLen=3, n.tok=p, n.isClosing=false][<p>][TextNode, StrLen=70: Vince Vaughn was torn down for reasons outside of his personal sphere.][TagNode, StrLen=8, n.tok=strong, n.isClosing=false][<strong>][TextNode, StrLen=77: Vaughn’s downfall came from his inability to vary his acting techniques][TagNode, StrLen=9, n.tok=strong, n.isClosing=true][</strong>][TextNode, StrLen=202: . Vaughn played the same character in every movie that he was in, he was never quite able to dump his goofy persona, even when acting in dramas. This is evident by his terrible season on True Detective.][TagNode, StrLen=4, n.tok=p, n.isClosing=true][</p>][TextNode, StrLen=1:
][CommentNode, StrLen=100: <!-- Programmers Note: Jim Caviezel plays 'The Man in the Suit' in TV show 'Person of Interest'. -->][TagNode, StrLen=4, n.tok=h2, n.isClosing=false][<h2>][TextNode, StrLen=12: Jim Caviezel][TagNode, StrLen=5, n.tok=h2, n.isClosing=true][</h2>][TextNode, StrLen=1:
][TagNode, StrLen=90, n.tok=img, n.isClosing=false][<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/8-9-1024x576.jpg'>][TextNode, StrLen=1:
][TagNode, StrLen=3, n.tok=p, n.isClosing=false][<p>][TextNode, StrLen=166: Caviezel was best known for his role as Jesus in The Passion of the Christ, directed by Mel Gibson. The movie made a bunch of money and received critical acclaim, but][TagNode, StrLen=8, n.tok=strong, n.isClosing=false][<strong>][TextNode, StrLen=89: the overdramatization and hyper-violent imagery was met with backlash from the community.][TagNode, StrLen=9, n.tok=strong, n.isClosing=true][</strong>][TextNode, StrLen=125: Caviezel has had a few small roles since The Passion of the Christ, but he has yet to be offered a full role in a film since.][TagNode, StrLen=4, n.tok=p, n.isClosing=true][</p>][TextNode, StrLen=1:
]
Print Style I (with UNIX Color-Codes)
UNIX Color-Coded Text, New-Lines Added (longer text), Class Names, TagNode Information Printed, String Lengths
[CommentNode, StrLen=97]
[<!-- This Content was copied from a Random Internet Photo Bomb Site. Practice Makes Perfect. -->]
[TagNode, StrLen=4, n.tok=h2, n.isClosing=false]
[<h2>]
[TextNode, StrLen=14]
[Dorothy Parker]
[TagNode, StrLen=5, n.tok=h2, n.isClosing=true]
[</h2>]
[TextNode, StrLen=1]
[
]
[TagNode, StrLen=93, n.tok=img, n.isClosing=false]
[<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/parker-1024x784.jpg'>]
[TextNode, StrLen=1]
[
]
[TagNode, StrLen=3, n.tok=p, n.isClosing=false]
[<p>]
[TextNode, StrLen=62]
[Parker was a very important screenwriter in the 1930s and 40s.]
[TagNode, StrLen=8, n.tok=strong, n.isClosing=false]
[<strong>]
[TextNode, StrLen=102]
[She wrote some incredible screenplays for Alfred Hitchcock but was accused of having ties to Communism]
[TagNode, StrLen=9, n.tok=strong, n.isClosing=true]
[</strong>]
[TextNode, StrLen=159]
[, which destroyed her career pretty much instantly. In 1949, Parker received a 1,000-word letter, acknowledging her blacklisting for reasons tied to suspicion.]
[TagNode, StrLen=4, n.tok=p, n.isClosing=true]
[</p>]
[TextNode, StrLen=1]
[
]
[TagNode, StrLen=4, n.tok=h2, n.isClosing=false]
[<h2>]
[TextNode, StrLen=12]
[Vince Vaughn]
[TagNode, StrLen=5, n.tok=h2, n.isClosing=true]
[</h2>]
[TextNode, StrLen=1]
[
]
[TagNode, StrLen=82, n.tok=img, n.isClosing=false]
[<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/7-11.jpg'>]
[TextNode, StrLen=1]
[
]
[TagNode, StrLen=3, n.tok=p, n.isClosing=false]
[<p>]
[TextNode, StrLen=70]
[Vince Vaughn was torn down for reasons outside of his personal sphere.]
[TagNode, StrLen=8, n.tok=strong, n.isClosing=false]
[<strong>]
[TextNode, StrLen=77]
[Vaughn’s downfall came from his inability to vary his acting techniques]
[TagNode, StrLen=9, n.tok=strong, n.isClosing=true]
[</strong>]
[TextNode, StrLen=202]
[. Vaughn played the same character in every movie that he was in, he was never quite able to dump his goofy persona, even when acting in dramas. This is evident by his terrible season on True Detective.]
[TagNode, StrLen=4, n.tok=p, n.isClosing=true]
[</p>]
[TextNode, StrLen=1]
[
]
[CommentNode, StrLen=100]
[<!-- Programmers Note: Jim Caviezel plays 'The Man in the Suit' in TV show 'Person of Interest'. -->]
[TagNode, StrLen=4, n.tok=h2, n.isClosing=false]
[<h2>]
[TextNode, StrLen=12]
[Jim Caviezel]
[TagNode, StrLen=5, n.tok=h2, n.isClosing=true]
[</h2>]
[TextNode, StrLen=1]
[
]
[TagNode, StrLen=90, n.tok=img, n.isClosing=false]
[<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/8-9-1024x576.jpg'>]
[TextNode, StrLen=1]
[
]
[TagNode, StrLen=3, n.tok=p, n.isClosing=false]
[<p>]
[TextNode, StrLen=166]
[Caviezel was best known for his role as Jesus in The Passion of the Christ, directed by Mel Gibson. The movie made a bunch of money and received critical acclaim, but]
[TagNode, StrLen=8, n.tok=strong, n.isClosing=false]
[<strong>]
[TextNode, StrLen=89]
[the overdramatization and hyper-violent imagery was met with backlash from the community.]
[TagNode, StrLen=9, n.tok=strong, n.isClosing=true]
[</strong>]
[TextNode, StrLen=125]
[Caviezel has had a few small roles since The Passion of the Christ, but he has yet to be offered a full role in a film since.]
[TagNode, StrLen=4, n.tok=p, n.isClosing=true]
[</p>]
[TextNode, StrLen=1]
[
]
Print Style J (with UNIX Color-Codes)
UNIX Color-Coded Text, No New-Lines Added (shorter text), No Class Names Nor Extra Information Printed, Just the 'node.str' Field Will Be Viewable. Colors Reflect Node/Class Type.
[<!-- This Content was copied from a Random Internet Photo Bomb Site. Practice Makes Perfect. -->][<h2>][Dorothy Parker][</h2>][
][<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/parker-1024x784.jpg'>][
][<p>][Parker was a very important screenwriter in the 1930s and 40s.][<strong>][She wrote some incredible screenplays for Alfred Hitchcock but was accused of having ties to Communism][</strong>][, which destroyed her career pretty much instantly. In 1949, Parker received a 1,000-word letter, acknowledging her blacklisting for reasons tied to suspicion.][</p>][
][<h2>][Vince Vaughn][</h2>][
][<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/7-11.jpg'>][
][<p>][Vince Vaughn was torn down for reasons outside of his personal sphere.][<strong>][Vaughn’s downfall came from his inability to vary his acting techniques][</strong>][. Vaughn played the same character in every movie that he was in, he was never quite able to dump his goofy persona, even when acting in dramas. This is evident by his terrible season on True Detective.][</p>][
][<!-- Programmers Note: Jim Caviezel plays 'The Man in the Suit' in TV show 'Person of Interest'. -->][<h2>][Jim Caviezel][</h2>][
][<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/8-9-1024x576.jpg'>][
][<p>][Caviezel was best known for his role as Jesus in The Passion of the Christ, directed by Mel Gibson. The movie made a bunch of money and received critical acclaim, but][<strong>][the overdramatization and hyper-violent imagery was met with backlash from the community.][</strong>][Caviezel has had a few small roles since The Passion of the Christ, but he has yet to be offered a full role in a film since.][</p>][
]
Print Style K (with UNIX Color-Codes)
UNIX Color-Coded Text, New-Lines Added (longer text), No Class Names Nor Extra Information Printed, Just the 'node.str' Field Will Be Viewable. Colors Reflect Node/Class Type.
[<!-- This Content was copied from a Random Internet Photo Bomb Site. Practice Makes Perfect. -->]
[<h2>]
[Dorothy Parker]
[</h2>]
[
]
[<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/parker-1024x784.jpg'>]
[
]
[<p>]
[Parker was a very important screenwriter in the 1930s and 40s.]
[<strong>]
[She wrote some incredible screenplays for Alfred Hitchcock but was accused of having ties to Communism]
[</strong>]
[, which destroyed her career pretty much instantly. In 1949, Parker received a 1,000-word letter, acknowledging her blacklisting for reasons tied to suspicion.]
[</p>]
[
]
[<h2>]
[Vince Vaughn]
[</h2>]
[
]
[<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/7-11.jpg'>]
[
]
[<p>]
[Vince Vaughn was torn down for reasons outside of his personal sphere.]
[<strong>]
[Vaughn’s downfall came from his inability to vary his acting techniques]
[</strong>]
[. Vaughn played the same character in every movie that he was in, he was never quite able to dump his goofy persona, even when acting in dramas. This is evident by his terrible season on True Detective.]
[</p>]
[
]
[<!-- Programmers Note: Jim Caviezel plays 'The Man in the Suit' in TV show 'Person of Interest'. -->]
[<h2>]
[Jim Caviezel]
[</h2>]
[
]
[<img width='750' src='https://upbeatnews.com/wp-content/uploads/2019/08/8-9-1024x576.jpg'>]
[
]
[<p>]
[Caviezel was best known for his role as Jesus in The Passion of the Christ, directed by Mel Gibson. The movie made a bunch of money and received critical acclaim, but]
[<strong>]
[the overdramatization and hyper-violent imagery was met with backlash from the community.]
[</strong>]
[Caviezel has had a few small roles since The Passion of the Christ, but he has yet to be offered a full role in a film since.]
[</p>]
[
]
Hi-Lited Source-Code:- View Here: Torello/HTML/Debug.java
- Open New Browser-Tab: Torello/HTML/Debug.java
File Size: 23,062 Bytes Line Count: 613 '\n' Characters Found
Stateless Class:This class neither contains any program-state, nor can it be instantiated. The@StaticFunctional
Annotation may also be called 'The Spaghetti Report'.Static-Functional
classes are, essentially, C-Styled Files, without any constructors or non-static member fields. It is a concept very similar to the Java-Bean's@Stateless
Annotation.
- 1 Constructor(s), 1 declared private, zero-argument constructor
- 17 Method(s), 17 declared static
- 1 Field(s), 1 declared static, 0 declared final
- Fields excused from final modifier (with explanation):
Field 'lastWasNewLine' is not final. Reason: FLAG
-
-
Method Summary
Print-Style Methods (Lambdas) Modifier and Type Method static void
A(HTMLNode n, StringBuffer sb)
static void
B(HTMLNode n, StringBuffer sb)
static void
C(HTMLNode n, StringBuffer sb)
static void
D(HTMLNode n, StringBuffer sb)
static void
E(HTMLNode n, StringBuffer sb)
static void
F(HTMLNode n, StringBuffer sb)
static void
G(HTMLNode n, StringBuffer sb)
static void
H(HTMLNode n, StringBuffer sb)
static void
I(HTMLNode n, StringBuffer sb)
static void
J(HTMLNode n, StringBuffer sb)
static void
K(HTMLNode n, StringBuffer sb)
Print Methods Modifier and Type Method static String
print(Vector<? extends HTMLNode> page, BiConsumer<HTMLNode,StringBuffer> printerVersion)
static String
print(SubSection sec, BiConsumer<HTMLNode,StringBuffer> printerVersion)
Print Methods, Range-Limited Modifier and Type Method static String
print(Vector<? extends HTMLNode> page, int sPos, int ePos, BiConsumer<HTMLNode,StringBuffer> printerVersion)
static String
print(Vector<? extends HTMLNode> page, DotPair dp, BiConsumer<HTMLNode,StringBuffer> printerVersion)
Print Methods, Vector-Index Array Limited Modifier and Type Method static String
print(Vector<? extends HTMLNode> page, int[] posArr, int radix, String nodesHaveBeenSkippedString, boolean addColorCurlyBracesToRequestedNodes, BiConsumer<HTMLNode,StringBuffer> printerVersion)
static String
print(Vector<? extends HTMLNode> page, int[] posArr, BiConsumer<HTMLNode,StringBuffer> printerVersion)
-
-
-
Method Detail
-
print
public static java.lang.String print (java.util.Vector<? extends HTMLNode> page, java.util.function.BiConsumer<HTMLNode,java.lang.StringBuffer> printerVersion)
Convenience Method
Invokes:print(Vector, int, int, BiConsumer)
Requests: Print entire'page' (Vector)
-
print
public static java.lang.String print (SubSection sec, java.util.function.BiConsumer<HTMLNode,java.lang.StringBuffer> printerVersion)
-
print
public static java.lang.String print (java.util.Vector<? extends HTMLNode> page, DotPair dp, java.util.function.BiConsumer<HTMLNode,java.lang.StringBuffer> printerVersion)
Convenience Method
Invokes:print(Vector, int, int, BiConsumer)
Requests: Print'page'
sub-range defined by parameter'dp'
-
print
public static java.lang.String print (java.util.Vector<? extends HTMLNode> page, int sPos, int ePos, java.util.function.BiConsumer<HTMLNode,java.lang.StringBuffer> printerVersion)
Converts HTML to aString
- adding readable notes & messages. This will print every node in the vectorized-html between starting-indexint sPos
(inclusively) and ending-indexint ePos
, exclusively.- Parameters:
page
- Any vectorized-html page or sub-page.sPos
- The printing of nodes will begin at position'sPos'
- inclusively.ePos
- The node at element-position will not be printed (exclusive), and the one previous shall print.printerVersion
- The complicated-looking function-pointer comes from the package'java.util.function.'
The literal code to pass to this parameter would be: Debug::A, Debug::B ... Debug::K. The programmer may also create a print-function if so desired, and pass that using a function-pointer or alambda-expression
- Returns:
- a pretty printed
String
of the nodes in thisVector
. - Throws:
java.lang.IndexOutOfBoundsException
- This exception shall be thrown if any of the following are true:- If
'sPos'
is negative, or ifsPos
is greater-than-or-equal-to thesize
of theVector
- If
'ePos'
is zero, or greater than the size of theVector
- If the value of
'sPos'
is a larger integer than'ePos'
. If'ePos'
was negative, it is first reset toVector.size()
, before this check is done.
- If
- See Also:
LV
- Code:
- Exact Method Body:
LV l = new LV(page, sPos, ePos); StringBuffer sb = new StringBuffer(); for (int i=l.start; i < l.end; i++) printerVersion.accept(page.elementAt(i), sb); return sb.toString();
-
print
public static java.lang.String print (java.util.Vector<? extends HTMLNode> page, int[] posArr, java.util.function.BiConsumer<HTMLNode,java.lang.StringBuffer> printerVersion)
Converts HTML to aString
- adding readable notes & messages. This version shall only print nodes whose index "is pointed to" by the elements of the position-index array parameterint[] posArr
.- Parameters:
page
- Any vectorized-html page or sub-page.posArr
- This is an array of index-pointers into the vectorized-html webpage parameter 'page.' These arrays are usually created by calls to thepackage NodeSearch
using classes with the'Find'
Key-Word. Such classes return integer-arrays of pointers to nodes that matched a specific search criteria.printerVersion
- The complicated-looking function-pointer comes from the package 'java.util.function.' The literal code to pass to this parameter would be: Debug::A, Debug::B ... Debug::K. The programmer may also create a print-function if so desired, and pass that using a function-pointer or alambda-expression
.- Returns:
- a pretty printed
String
of the nodes in thisVector
pointed-to by the elements of'posArr'
- Throws:
java.lang.ArrayIndexOutOfBoundsException
- If any of the elements in'posArr'
contain index-pointers that are out of range ofVector
parameter'page'
, then java will, naturally, throw this exception.- Code:
- Exact Method Body:
StringBuffer sb = new StringBuffer(); for (int i : posArr) printerVersion.accept(page.elementAt(i), sb); return sb.toString();
-
print
public static java.lang.String print (java.util.Vector<? extends HTMLNode> page, int[] posArr, int radix, java.lang.String nodesHaveBeenSkippedString, boolean addColorCurlyBracesToRequestedNodes, java.util.function.BiConsumer<HTMLNode,java.lang.StringBuffer> printerVersion)
Converts HTML to aString
- adding readable notes & messages. This version shall only print nodes whose index "is pointed to" by the elements of the position-index array parameterint[] posArr
.
Note about Usability:
This version of print can be invaluable during debugging when trolling through pages of HTML is reduced to only the indexes that are indicated by an index-pointer array. The addition of a "radix" means that some nodes before and after the identified node can be looked at too.- Parameters:
page
- Any vectorized-html page or sub-page.posArr
- This is an array of index-pointers into the vectorized-html webpage parameter'page'
. These arrays are usually created by calls to thepackage NodeSearch
using classes with the'Find'
Key-Word. Such classes return integer-arrays of pointers to nodes that matched a specific search criteria.radix
- The number of nodes, in both the forward and reverse directions, to include in the output for a match.nodesHaveBeenSkippedString
- This will be printed whenever the print-logic has skipped nodes in the list during printing. An example of a goodString
to use would just beSting s = "***** Nodes Skipped *****\n";
, but any choice will do - so long as it gives the appearance the during printing there are "blank spots" that skipped some of the content of the html.addColorCurlyBracesToRequestedNodes
- If this isTRUE
, and theclass Shell.C
has its colorString
evaluated, because the program is running on some acceptable version of UNIX, then a bright-green colored curly-brace set will surround each node that is explicitly a member of the index-pointer-array, parameter'posArr'
NOTE: If this is unclear, this method prints every node that is pointed-to by the'posArr'
parameter. In addition to these nodes, it will print'radix'
nodes before and'radix'
nodes after each of the elements pointed to by the'posArr'
parameter. When viewing the output, if it is important to know which nodes are explicitly in the 'request-list' then adding bright-green curly braces to those output nodes will differentiate them from other nodes that are being printed because of theradix
parameter.printerVersion
- The complicated-looking function-pointer comes from the package'java.util.function.'
The literal code to pass to this parameter would be: Debug::A, Debug::B ... Debug::K. The programmer may also create a print-function if so desired, and pass that using a function-pointer or alambda-expression
- Returns:
- a pretty printed
String
of the nodes in thisVector
pointed-to by the elements of'posArr'
, surrounded by'radix'
number of nodes in either direction. - Throws:
java.lang.ArrayIndexOutOfBoundsException
- If any of the elements inposArr
contain index-pointers that are out of range ofVector
-parameter'page'
, then java will, naturally, throw this exception- See Also:
C
- Code:
- Exact Method Body:
StringBuffer sb = new StringBuffer(); // Used internally to print-curly braces TreeSet<Integer> ts = null; // Initialize it if the curly-braces are requested if (addColorCurlyBracesToRequestedNodes) { ts = new TreeSet<>(); for (int pos : posArr) ts.add(Integer.valueOf(pos)); } int start = 0; int end = 0; for (int i : posArr) { // Start at precisely the current index-pointer MINUS the radix. // OR ... If the loop is about to "reprint" a node because the radix is larger than the // space between two consecutive nodes - then start at the node just after the // last node that was printed. start = Math.max(i - radix, end + 1); // A large radix might get the loop past the end of the vector, AVOID THAT. if (start > (page.size() - 1)) break; // If the next node to be printed is immediately after the previous node that was // printed IN THE UNDERLYING HTML, then no nodes have been skipped, so don't print the // "nodesHaveBeenSkippedString" ... otherwise print it! if (start > (end + 1)) sb.append(nodesHaveBeenSkippedString); // Make sure not to go past the last node in the string, or exception will throw. end = Math.min(i + radix, (page.size() - 1)); // It is possible that 'start' is greater than 'end' (too much overlap), in which case // the outer loop will continue on to the next index-pointer. // NOTE: uses 'j <= end' NOT 'j < end' !!! (TRICKY) if (addColorCurlyBracesToRequestedNodes) for (int j=start; j <= end; j++) { boolean addColorBrackets = ts.contains(Integer.valueOf(j)); if (addColorBrackets) sb.append(BGREEN + "{" + RESET); printerVersion.accept(page.elementAt(j), sb); if (addColorBrackets) sb.append(BGREEN + "}" + RESET); } else for (int j=start; j <= end; j++) printerVersion.accept(page.elementAt(j), sb); } return sb.toString();
-
A
public static void A(HTMLNode n, java.lang.StringBuffer sb)
Prints an HTML Element (TagNode, TextNode
orCommentNode
) usingPrint Style 'A'
- Parameters:
n
- AnHTMLNode
that will print to theStringBuffer
sb
- theStringBuffer
that is receiving the print command.- See Also:
HTMLNode.str
- Code:
- Exact Method Body:
String name = n.getClass().getSimpleName(); // Extremely Unlikely Programmer has extended HTMLNode, but just in case, to prevent // exception. if (name.equals("")) name = "Anonymous Class"; sb.append("[" + name + ":" + n.str + "]");
-
B
public static void B(HTMLNode n, java.lang.StringBuffer sb)
Prints an HTML Element (TagNode, TextNode
orCommentNode
) usingPrint Style 'B'
- Parameters:
n
- AnHTMLNode
that will print to theStringBuffer
sb
- theStringBuffer
that is receiving the print command.- See Also:
HTMLNode.str
- Code:
- Exact Method Body:
String name = n.getClass().getSimpleName(); // Extremely Unlikely Programmer has extended HTMLNode, but just in case, to prevent // exception. if (name.equals("")) name = "Anonymous Class"; sb.append("[" + name + ", StrLen=" + n.str.length() + ": " + n.str + "]");
-
C
public static void C(HTMLNode n, java.lang.StringBuffer sb)
Prints an HTML Element (TagNode, TextNode
orCommentNode
) usingPrint Style 'C'
- Parameters:
n
- AnHTMLNode
that will print to theStringBuffer
sb
- theStringBuffer
that is receiving the print command.- See Also:
HTMLNode.str
,TagNode.tok
,TagNode.isClosing
- Code:
- Exact Method Body:
String name = n.getClass().getSimpleName(); // Extremely Unlikely Programmer has extended HTMLNode, but just in case, to prevent // exception. if (name.equals("")) name = "Anonymous Class"; if (n.isTagNode()) sb.append( "[" + name + ", n.tok=" + ((TagNode) n).tok + ", " + "n.isClosing=" + ((TagNode) n).isClosing + ": " + n.str + "]" ); else sb.append("[" + name + ": " + n.str + "]");
-
D
public static void D(HTMLNode n, java.lang.StringBuffer sb)
Prints an HTML Element (TagNode, TextNode
orCommentNode
) usingPrint Style 'D'
- Parameters:
n
- AnHTMLNode
that will print to theStringBuffer
sb
- theStringBuffer
that is receiving the print command.- See Also:
HTMLNode.str
,TagNode.tok
,TagNode.isClosing
- Code:
- Exact Method Body:
String name = n.getClass().getSimpleName(); // Extremely Unlikely Programmer has extended HTMLNode, but just in case, to prevent // exception. if (name.equals("")) name = "Anonymous Class"; if (n.isTagNode()) sb.append( "[" + name + ", StrLen=" + n.str.length() + ", n.tok=" + ((TagNode) n).tok + ", " + "n.isClosing=" + ((TagNode) n).isClosing + ": " + n.str + "]" ); else sb.append("[" + name + ", StrLen=" + n.str.length() + ": " + n.str + "]");
-
E
public static void E(HTMLNode n, java.lang.StringBuffer sb)
Prints an HTML Element (TagNode, TextNode
orCommentNode
) usingPrint Style 'E'
- Parameters:
n
- AnHTMLNode
that will print to theStringBuffer
sb
- theStringBuffer
that is receiving the print command.- See Also:
HTMLNode.str
,TagNode.tok
,TagNode.isClosing
- Code:
- Exact Method Body:
String name = n.getClass().getSimpleName(); // Extremely Unlikely Programmer has extended HTMLNode, but just in case, to prevent // exception. if (name.equals("")) name = "Anonymous Class"; if (n.isTagNode()) sb.append( "[" + name + ", StrLen=" + n.str.length() + ", n.tok=" + ((TagNode) n).tok + ", " + "n.isClosing=" + ((TagNode) n).isClosing + "]\n[" + n.str + "]\n" ); else sb.append("[" + name + ", StrLen=" + n.str.length() + "]\n[" + n.str + "]\n");
-
F
public static void F(HTMLNode n, java.lang.StringBuffer sb)
Prints an HTML Element (TagNode, TextNode
orCommentNode
) usingPrint Style 'F'
- Parameters:
n
- AnHTMLNode
that will print to theStringBuffer
sb
- theStringBuffer
that is receiving the print command.- See Also:
HTMLNode.str
,TagNode.isClosing
,TagNode.toStringAV()
- Code:
- Exact Method Body:
String name = n.getClass().getSimpleName(); // Extremely Unlikely Programmer has extended HTMLNode, but just in case, to prevent // exception. if (name.equals("")) name = "Anonymous Class"; if (n.isTagNode() && (! ((TagNode) n).isClosing)) sb.append(((TagNode) n).toStringAV()); else sb.append("[" + name + ", StrLen=" + n.str.length() + "]\n[" + n.str + "]\n");
-
G
public static void G(HTMLNode n, java.lang.StringBuffer sb)
Prints an HTML Element (TagNode, TextNode
orCommentNode
) usingPrint Style 'G'
Thread Safety Point:
Print Style G is notThread
safe!.- Parameters:
n
- AnHTMLNode
that will print to theStringBuffer
sb
- theStringBuffer
that is receiving the print command.- See Also:
HTMLNode.str
,TagNode.tok
,TagNode.isClosing
,TagNode.toStringAV()
- Code:
- Exact Method Body:
String name = n.getClass().getSimpleName(); // Extremely Unlikely Programmer has extended HTMLNode, but just in case, to prevent // exception. if (name.equals("")) name = "Anonymous Class"; TagNode tn = null; if ( n.isTagNode() && (! (tn = (TagNode) n).isClosing) && (tn.str.length() > (tn.tok.length() + 4)) ) { sb.append((lastWasNewLine ? "" : "\n") + ((TagNode) n).toStringAV()); lastWasNewLine = true; } else { sb.append("[" + name + ", StrLen=" + n.str.length() + ": " + n.str + "]"); lastWasNewLine = false; };
-
H
public static void H(HTMLNode n, java.lang.StringBuffer sb)
Prints an HTML Element (TagNode, TextNode
orCommentNode
) usingPrint Style 'H'
- Parameters:
n
- AnHTMLNode
that will print to theStringBuffer
sb
- theStringBuffer
that is receiving the print command.- See Also:
C(Torello.HTML.HTMLNode,java.lang.StringBuffer)
,RESET(Torello.HTML.HTMLNode, java.lang.StringBuffer)
,BRED(Torello.HTML.HTMLNode, java.lang.StringBuffer)
,BCYAN(Torello.HTML.HTMLNode, java.lang.StringBuffer)
,HTMLNode.str
,TagNode.tok
,TagNode.isClosing
- Code:
- Exact Method Body:
String name = n.getClass().getSimpleName(); // Extremely Unlikely Programmer has extended HTMLNode, but just in case, to prevent // exception. if (name.equals("")) name = "Anonymous Class"; if (n.isTagNode()) sb.append( "[" + name + ", StrLen=" + BCYAN + n.str.length() + RESET + ", " + "n.tok=" + BCYAN + ((TagNode) n).tok + RESET +", " + "n.isClosing=" + BCYAN + ((TagNode) n).isClosing + RESET + "]" + "[" + BRED + n.str + RESET + "]" ); else sb.append( "[" + name + ", StrLen=" + BCYAN + n.str.length() + RESET + ": " + BRED + n.str + RESET + "]" );
-
I
public static void I(HTMLNode n, java.lang.StringBuffer sb)
Prints an HTML Element (TagNode, TextNode
orCommentNode
) usingPrint Style 'I'
- Parameters:
n
- AnHTMLNode
that will print to theStringBuffer
sb
- theStringBuffer
that is receiving the print command.- See Also:
C(Torello.HTML.HTMLNode,java.lang.StringBuffer)
,RESET(Torello.HTML.HTMLNode, java.lang.StringBuffer)
,BRED(Torello.HTML.HTMLNode, java.lang.StringBuffer)
,BCYAN(Torello.HTML.HTMLNode, java.lang.StringBuffer)
,HTMLNode.str
,TagNode.tok
- Code:
- Exact Method Body:
String name = n.getClass().getSimpleName(); // Extremely Unlikely Programmer has extended HTMLNode, but just in case, to prevent // exception. if (name.equals("")) name = "Anonymous Class"; if (n.isTagNode()) sb.append( "[" + name + ", StrLen=" + BCYAN + n.str.length() + RESET + ", " + "n.tok=" + BCYAN + ((TagNode) n).tok + RESET + ", " + "n.isClosing=" + BCYAN + ((TagNode) n).isClosing + RESET + "]\n" + "[" + BRED + n.str + RESET + "]\n" ); else sb.append( "[" + name + ", StrLen=" + BCYAN + n.str.length() + RESET + "]\n" + "[" + BRED + n.str + RESET + "]\n" );
-
J
public static void J(HTMLNode n, java.lang.StringBuffer sb)
Prints an HTML Element (TagNode, TextNode
orCommentNode
) usingPrint Style 'J'
- Parameters:
n
- AnHTMLNode
that will print to theStringBuffer
sb
- theStringBuffer
that is receiving the print command.- See Also:
C(Torello.HTML.HTMLNode,java.lang.StringBuffer)
,RESET(Torello.HTML.HTMLNode, java.lang.StringBuffer)
,BRED(Torello.HTML.HTMLNode, java.lang.StringBuffer)
,BYELLOW(Torello.HTML.HTMLNode, java.lang.StringBuffer)
,HTMLNode.str
- Code:
- Exact Method Body:
String name = n.getClass().getSimpleName(); // Extremely Unlikely Programmer has extended HTMLNode, but just in case, to prevent // exception. if (name.equals("")) name = "Anonymous Class"; if (n.isTagNode()) sb.append("[" + BRED + n.str + RESET + "]"); else if (n.isCommentNode()) sb.append("[" + BYELLOW + n.str + RESET + "]"); else sb.append("[" + n.str + "]");
-
K
public static void K(HTMLNode n, java.lang.StringBuffer sb)
Prints an HTML Element (TagNode, TextNode
orCommentNode
) usingPrint Style 'K'
- Parameters:
n
- AnHTMLNode
that will print to theStringBuffer
sb
- theStringBuffer
that is receiving the print command.- See Also:
C(Torello.HTML.HTMLNode,java.lang.StringBuffer)
,RESET(Torello.HTML.HTMLNode, java.lang.StringBuffer)
,BRED(Torello.HTML.HTMLNode, java.lang.StringBuffer)
,BYELLOW(Torello.HTML.HTMLNode, java.lang.StringBuffer)
,HTMLNode.str
- Code:
- Exact Method Body:
String name = n.getClass().getSimpleName(); // Extremely Unlikely Programmer has extended HTMLNode, but just in case, to prevent exception. if (name.equals("")) name = "Anonymous Class"; if (n.isTagNode()) sb.append("[" + BRED + n.str + RESET + "]\n"); else if (n.isCommentNode()) sb.append("[" + BYELLOW + n.str + RESET + "]\n"); else sb.append("[" + n.str + "]\n");
-
-