Package Torello.HTML.NodeSearch
Class CommentNodePoll
- java.lang.Object
-
- Torello.HTML.NodeSearch.CommentNodePoll
-
public class CommentNodePoll extends java.lang.Object
CommentNodePoll 🠞CommentNode:This implies thatTagNodeandTextNodeelements are ignored completely in this search, and instead, the "comments" between the<!--and-->symbols - which are all instances ofCommentNode, are searched.
Poll:This refers to the operation of both removing and returningnodematches to the programmer. After a'poll'operation, the initial vectorized-html will actually contain fewer elements - and the removed elements shall be returned to the calling method.
Searches for, and extracts, HTML Comments from Vectorized-HTML that match a user-specified search-criteria, and returns those extracted node or nodes.
Methods Available
Method Explanation first (...) This will retrieve an integer-pointer to the first CommentNodematch found in the vectorized-page parameter'html'.nth (...) This will retrieve an integer-pointer to the nth CommentNodematch found in the vectorized-page parameter'html'.last (...) This will retrieve an integer-pointer to the last CommentNodematch found in the vectorized-page parameter'html'.nthFromEnd (...) This will retrieve an integer-pointer to the nth-from-last CommentNodematch found in the vectorized-page parameter'html'.all (...) This will retrieve an integer-pointer to every CommentNodefound in the vectorized-page parameter'html'that matches the specified search-criteria.allExcept (...) This will retrieve an integer-pointer to every CommentNodefound in the vectorized-page parameter'html'that does not match the specified search-criteria.Method Parameters
Parameter Explanation Vector<? extends HTMLNode> htmlThis represents any vectorized HTML page, sub-page, or list of partial-elements. int nthThis represents the 'nth'match of a comparisonfor-loop. When the method-signature used includes the parameter'nth', the firstn-1matches that are found - will be skipped, and the'nth'match is, instead, returned.
EXCEPTIONS: AnNExceptionshall throw if the value of parameter'nth'is zero, negative, or larger than the size of the input html-Vector.int sPos, int ePosWhen these parameters are present, only HTMLNode'sthat are found between the specifiedVectorindices will be considered for matching with the search criteria.
NOTE: In every situation where the parametersint sPos, int ePosare used, parameter'ePos'will accept a negative value, but parameter'sPos'will not. When'ePos'is passed a negative-value, the internalLV('Loop Variable Counter') will have itspublic final int endfield set to the length of the vectorized-html page that was passed. (html.size()of parameterVector<HTMLNode> html).
EXCEPTIONS: AnIndexOutOfBoundsExceptionwill be thrown if:- If
sPosis negative, or ifsPosis greater-than or equal-to the size of the inputVector - If
ePosis zero, or greater than the size of the inputVector. - If
sPosis a larger integer thanePos
TextComparitor tcWORKS WITH: This parameter utilizes / works-with parameter String... compareStrto perform the requested comparisons. The comparisons are computed using theString 'body'field of aCommentNode.
When this parameter is present in the method-signature parameter-list, the decision of whether aCommentNodeis to be included in the search result-set is defined by this parameter'sFunctionalInterface Predicate 'test'method.TextComparitoris a JavaBiPredicate<String, String[]>which compares its firstString-parameter against theString'sin its second.Pattern pThese parameters reference Java's "Regular Expression" processing engine. If the method-signature includes the java.util.regex.Patternparameter, the search-loops will use the standard Regular-ExpressionPatternmatching routine:p.asPredicate().test(comment_node.body)when deciding whichCommentNode's"match" this search-criteria.Predicate<String> pWhen this parameter is present in the method-signature parameter-list, the decision of whether a CommentNodeis to be included in the search result-set are made by the results of the JavaPredicate.test(String)method.
Specifically:p.test(comment_node.body)String... compareStrWORKS WITH: This parameter works in coordination with the TextComparitor tcparameter. This parameter supplies theString'swith which the comparisons of theCommentNode.bodyfield may be compared.Return Values:
CommentNoderepresents a matchedCommentNodefrom the html vectorized-page parameter'html'- after having been removed from the underlying vector, first- A return value of
nullimplies no matches were found. Vector<CommentNode>- A vector ofCommentNoderepresent all matches from the vectorized-page parameter'html'- all of which were also removed from the underlying vector.- A zero-length
Vector<CommentNode>means no matches were found on the page or sub-page. Empty Vectors are returned from any method where the possibility existed for multiple-matches being provided as a result-set.
Hi-Lited Source-Code:This File's Source Code:
- View Here: Torello/HTML/NodeSearch/CommentNodePoll.java
- Open New Browser-Tab: Torello/HTML/NodeSearch/CommentNodePoll.java
File Size: 9,019 Bytes Line Count: 131 '\n' Characters Found
Actual Search Loop Class:
- View Here: SearchLoops/CommentNodes/CmtNPoll.java
- Open New Browser-Tab: SearchLoops/CommentNodes/CmtNPoll.java
File Size: 2,281 Bytes Line Count: 82 '\n' Characters Found
Argument Checker Class:
- View Here: ARGCHECK.java
- Open New Browser-Tab: ARGCHECK.java
File Size: 17,874 Bytes Line Count: 425 '\n' Characters Found
Stateless Class:This class neither contains any program-state, nor can it be instantiated. The@StaticFunctionalAnnotation may also be called 'The Spaghetti Report'.Static-Functionalclasses are, essentially, C-Styled Files, without any constructors or non-static member fields. It is a concept very similar to the Java-Bean's@StatelessAnnotation.
- 1 Constructor(s), 1 declared private, zero-argument constructor
- 36 Method(s), 36 declared static
- 0 Field(s)
-
-
Method Summary
All Matches Modifier and Type Method static Vector<CommentNode>all(Vector<? extends HTMLNode> html, Predicate<String> p)static Vector<CommentNode>all(Vector<? extends HTMLNode> html, Pattern p)static Vector<CommentNode>all(Vector<? extends HTMLNode> html, TextComparitor tc, String... compareStr)All Matches, Range Limited Modifier and Type Method static Vector<CommentNode>all(Vector<? extends HTMLNode> html, int sPos, int ePos, Predicate<String> p)static Vector<CommentNode>all(Vector<? extends HTMLNode> html, int sPos, int ePos, Pattern p)static Vector<CommentNode>all(Vector<? extends HTMLNode> html, int sPos, int ePos, TextComparitor tc, String... compareStr)All Non-Matches Modifier and Type Method static Vector<CommentNode>allExcept(Vector<? extends HTMLNode> html, Predicate<String> p)static Vector<CommentNode>allExcept(Vector<? extends HTMLNode> html, Pattern p)static Vector<CommentNode>allExcept(Vector<? extends HTMLNode> html, TextComparitor tc, String... compareStr)All Non-Matches, Range Limited Modifier and Type Method static Vector<CommentNode>allExcept(Vector<? extends HTMLNode> html, int sPos, int ePos, Predicate<String> p)static Vector<CommentNode>allExcept(Vector<? extends HTMLNode> html, int sPos, int ePos, Pattern p)static Vector<CommentNode>allExcept(Vector<? extends HTMLNode> html, int sPos, int ePos, TextComparitor tc, String... compareStr)First Match Modifier and Type Method static CommentNodefirst(Vector<? extends HTMLNode> html, Predicate<String> p)static CommentNodefirst(Vector<? extends HTMLNode> html, Pattern p)static CommentNodefirst(Vector<? extends HTMLNode> html, TextComparitor tc, String... compareStr)First Match, Range Limited Modifier and Type Method static CommentNodefirst(Vector<? extends HTMLNode> html, int sPos, int ePos, Predicate<String> p)static CommentNodefirst(Vector<? extends HTMLNode> html, int sPos, int ePos, Pattern p)static CommentNodefirst(Vector<? extends HTMLNode> html, int sPos, int ePos, TextComparitor tc, String... compareStr)Last Match Modifier and Type Method static CommentNodelast(Vector<? extends HTMLNode> html, Predicate<String> p)static CommentNodelast(Vector<? extends HTMLNode> html, Pattern p)static CommentNodelast(Vector<? extends HTMLNode> html, TextComparitor tc, String... compareStr)Last Match, Range Limited Modifier and Type Method static CommentNodelast(Vector<? extends HTMLNode> html, int sPos, int ePos, Predicate<String> p)static CommentNodelast(Vector<? extends HTMLNode> html, int sPos, int ePos, Pattern p)static CommentNodelast(Vector<? extends HTMLNode> html, int sPos, int ePos, TextComparitor tc, String... compareStr)Nth Match Modifier and Type Method static CommentNodenth(Vector<? extends HTMLNode> html, int nth, Predicate<String> p)static CommentNodenth(Vector<? extends HTMLNode> html, int nth, Pattern p)static CommentNodenth(Vector<? extends HTMLNode> html, int nth, TextComparitor tc, String... compareStr)Nth Match, Range Limited Modifier and Type Method static CommentNodenth(Vector<? extends HTMLNode> html, int nth, int sPos, int ePos, Predicate<String> p)static CommentNodenth(Vector<? extends HTMLNode> html, int nth, int sPos, int ePos, Pattern p)static CommentNodenth(Vector<? extends HTMLNode> html, int nth, int sPos, int ePos, TextComparitor tc, String... compareStr)Nth Match From End Modifier and Type Method static CommentNodenthFromEnd(Vector<? extends HTMLNode> html, int nth, Predicate<String> p)static CommentNodenthFromEnd(Vector<? extends HTMLNode> html, int nth, Pattern p)static CommentNodenthFromEnd(Vector<? extends HTMLNode> html, int nth, TextComparitor tc, String... compareStr)Nth Match From End, Range Limited Modifier and Type Method static CommentNodenthFromEnd(Vector<? extends HTMLNode> html, int nth, int sPos, int ePos, Predicate<String> p)static CommentNodenthFromEnd(Vector<? extends HTMLNode> html, int nth, int sPos, int ePos, Pattern p)static CommentNodenthFromEnd(Vector<? extends HTMLNode> html, int nth, int sPos, int ePos, TextComparitor tc, String... compareStr)
-