Package Torello.HTML.NodeSearch
Class JS
- java.lang.Object
-
- Torello.HTML.NodeSearch.JS
-
public class JS extends java.lang.Object
A 'work-book' class included in the Java-HTML JAR-Library, mostly in order to demonstrate the similarities between searching a Java Script DOM-Tree and searching Vectorized-HTML for tags, text and comments.
This class attempts to mimic the java-scripts methods:- getElementsByTagName()
- getElementsByClassName()
- getElementById()
- getElementsByName()
This class adds many additional versions of these standard Java-Script library methods which assist a programmer to retrieve the vector-index integer-pointer using a 'find' method instead of a 'get' method. The other five versions including count, get, remove, peek, and poll are also included. Below is a table that describes the precise-meaning of the key-words used in these "Extra Java-Script Methods."Count:
This implies that a count of the number of nodes that have matched a specified search criteria shall be computed. Methods named 'Count' will always return single-integers that represent this count.Find:
This implies that integer-arrays, or single-integer are returned by the methods that use this word. These integers are intended to function as pointers into the underlying JavaVector
. A method or class with the word 'Find' will always return a pointer (integer-index, or indices), not a node.Get:
This implies thatHTMLNode's: TagNode, TextNode, CommentNode
are returned by these Java-Script-like methods. Integer-pointers (a.k.a. the integer-index into the underlyingVector
) are not returned.Peek:
This implies that BOTH theVector
-index AND the HTML node found at-that-integer-index-location are SIMULTANEOUSLY returned by these methods. It is here that these (sort-of) 'extra' data-classesNodeIndex, TagNodeIndex, TextNodeIndex
are used. These data-classes are always used as return values for methods that contain the word 'Peek'.Poll:
This refers to the operation of both removing a node from the vectorized-html web-page, and then returning that node (or those nodes) back to the programmer as a return value. Remember, for all methods that use the word'Poll'
in their name - after such a method finishes, the initial vectorized-html, itself, will contain fewer elements.Remove:
This implies that neither nodes nor node-pointers are returned, but rather in this case (cases in which a method or class uses the key-word 'Remove') - nodes are actually extracted from the vectorized html-page. Afterwards an integer is returned that lets the caller know precisely how many nodes have been removed. Just as in a 'Poll' operation, after a 'Remove' the initial vectorized-html, itself, shall have fewer elements.
Hi-Lited Source-Code:- View Here: Torello/HTML/NodeSearch/JS.java
- Open New Browser-Tab: Torello/HTML/NodeSearch/JS.java
File Size: 37,131 Bytes Line Count: 769 '\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
- 43 Method(s), 43 declared static
- 0 Field(s)
-
-
Method Summary
JavaScript: getElementsByTagName(...), Just the TagNode Modifier and Type Method static int
countElementsByTagName(Vector<HTMLNode> html, String htmlTok)
static int[]
findElementsByTagName(Vector<HTMLNode> html, String htmlTok)
static Vector<TagNode>
getElementsByTagName(Vector<HTMLNode> html, String htmlTok)
static Vector<TagNodeIndex>
peekElementsByTagName(Vector<HTMLNode> html, String htmlTok)
static Vector<TagNode>
pollElementsByTagName(Vector<HTMLNode> html, String htmlTok)
static int
removeElementsByTagName(Vector<HTMLNode> html, String htmlTok)
JavaScript: getElementsByTagName(...).innerHTML Modifier and Type Method static Vector<DotPair>
findElementsByTagNameInclusive(Vector<HTMLNode> html, String htmlTok)
static Vector<Vector<HTMLNode>>
getElementsByTagNameInclusive(Vector<HTMLNode> html, String htmlTok)
static Vector<SubSection>
peekElementsByTagNameInclusive(Vector<HTMLNode> html, String htmlTok)
static Vector<Vector<HTMLNode>>
pollElementsByTagNameInclusive(Vector<HTMLNode> html, String htmlTok)
static int
removeElementsByTagNameInclusive(Vector<HTMLNode> html, String htmlTok)
JavaScript: getElementsByClassName(...), Just the TagNode Modifier and Type Method static int
countElementsByClassName(Vector<HTMLNode> html, String className)
static int[]
findElementsByClassName(Vector<HTMLNode> html, String className)
static Vector<TagNode>
getElementsByClassName(Vector<HTMLNode> html, String className)
static Vector<TagNodeIndex>
peekElementsByClassName(Vector<HTMLNode> html, String className)
static Vector<TagNode>
pollElementsByClassName(Vector<HTMLNode> html, String className)
static int
removeElementsByClassName(Vector<HTMLNode> html, String className)
JavaScript: getElementsByClassName(...).innerHTML Modifier and Type Method static Vector<DotPair>
findElementsByClassNameInclusive(Vector<HTMLNode> html, String className)
static Vector<Vector<HTMLNode>>
getElementsByClassNameInclusive(Vector<HTMLNode> html, String className)
static Vector<SubSection>
peekElementsByClassNameInclusive(Vector<HTMLNode> html, String className)
static Vector<Vector<HTMLNode>>
pollElementsByClassNameInclusive(Vector<HTMLNode> html, String className)
static int
removeElementsByClassNameInclusive(Vector<HTMLNode> html, String className)
JavaScript: getElementById(...), Just the TagNode Modifier and Type Method static int
findElementById(Vector<HTMLNode> html, String id)
static TagNode
getElementById(Vector<HTMLNode> html, String id)
static TagNodeIndex
peekElementById(Vector<HTMLNode> html, String id)
static TagNode
pollElementById(Vector<HTMLNode> html, String id)
static int
removeElementById(Vector<HTMLNode> html, String id)
JavaScript: getElementById(...).innerHTML Modifier and Type Method static DotPair
findElementByIdInclusive(Vector<HTMLNode> html, String id)
static Vector<HTMLNode>
getElementByIdInclusive(Vector<HTMLNode> html, String id)
static SubSection
peekElementByIdInclusive(Vector<HTMLNode> html, String id)
static Vector<HTMLNode>
pollElementByIdInclusive(Vector<HTMLNode> html, String id)
static int
removeElementByIdInclusive(Vector<HTMLNode> html, String id)
JavaScript: getElementsByName(...), Just the TagNode Modifier and Type Method static int
countElementsByName(Vector<HTMLNode> html, String name)
static int[]
findElementsByName(Vector<HTMLNode> html, String name)
static Vector<TagNode>
getElementsByName(Vector<HTMLNode> html, String name)
static Vector<TagNodeIndex>
peekElementsByName(Vector<HTMLNode> html, String name)
static Vector<TagNode>
pollElementsByName(Vector<HTMLNode> html, String name)
static int
removeElementsByName(Vector<HTMLNode> html, String name)
JavaScript: getElementsByName(...).innerHTML Modifier and Type Method static Vector<DotPair>
findElementsByNameInclusive(Vector<HTMLNode> html, String name)
static Vector<Vector<HTMLNode>>
getElementsByNameInclusive(Vector<HTMLNode> html, String name)
static Vector<SubSection>
peekElementsByNameInclusive(Vector<HTMLNode> html, String name)
static Vector<Vector<HTMLNode>>
pollElementsByNameInclusive(Vector<HTMLNode> html, String name)
static int
removeElementsByNameInclusive(Vector<HTMLNode> html, String name)
-
-
-
Method Detail
-
findElementById
public static int findElementById(java.util.Vector<HTMLNode> html, java.lang.String id)
Java-Script's Element by ID function retrieves all HTMLTagNode
Elements that have a specified CSSID
-Attribute.
Find:
These operations return the integerVector
-indices which point to nodes in the original html-Vector
that match the specified criteria.- Parameters:
html
- This may be any vectorized-html page, or sub-page.id
- This should be a valid HTML'ID'
Attribute-Value (inner-tag value). This is also known as a CSS-Style-Sheet'ID'
Tag.- Returns:
- The integer vector-index of the first HTML
TagNode
Element that matches the specified criteria. - Throws:
CSSStrException
- This exception will throw if theString
passed to the'id'
parameter is not a valid CSS'ID'
. Please review the ExceptionCSSStrException
to see what constitutes a valid CSS'ID'
.- See Also:
InnerTagFind
- Code:
- Exact Method Body:
CSSStrException.check(id); return InnerTagFind.first(html, "id", TextComparitor.EQ_CI_TRM, id);
-
getElementById
public static TagNode getElementById(java.util.Vector<HTMLNode> html, java.lang.String id)
Java-Script's Element by ID function retrieves all HTMLTagNode
Elements that have a specified CSSID
-Attribute.
Get:
These operations return the nodes that match the specified criteria.- Parameters:
html
- This may be any vectorized-html page, or sub-page.id
- This should be a valid HTML'ID'
Attribute-Value (inner-tag value). This is also known as a CSS-Style-Sheet'ID'
Tag.- Returns:
- The first HTML
TagNode
Element that matches the specified criteria. - Throws:
CSSStrException
- This exception will throw if theString
passed to the'id'
parameter is not a valid CSS'ID'
. Please review the ExceptionCSSStrException
to see what constitutes a valid CSS'ID'
.- See Also:
InnerTagGet
- Code:
- Exact Method Body:
CSSStrException.check(id); return InnerTagGet.first(html, "id", TextComparitor.EQ_CI_TRM, id);
-
removeElementById
public static int removeElementById(java.util.Vector<HTMLNode> html, java.lang.String id)
Java-Script's Element by ID function retrieves all HTMLTagNode
Elements that have a specified CSSID
-Attribute.
Remove:
These operations remove nodes that match the specified criteria, and then, afterwards, return an integer'count'
- informing the user how many nodes were actually removed.- Parameters:
html
- This may be any vectorized-html page, or sub-page.id
- This should be a valid HTML'ID'
Attribute-Value (inner-tag value). This is also known as a CSS-Style-Sheet'ID'
Tag.- Returns:
- The total number of HTML Nodes that were removed from the
input-
Vector 'html'
- Throws:
CSSStrException
- This exception will throw if theString
passed to the'id'
parameter is not a valid CSS'ID'
. Please review the ExceptionCSSStrException
to see what constitutes a valid CSS'ID'
.- See Also:
InnerTagRemove
- Code:
- Exact Method Body:
CSSStrException.check(id); return InnerTagRemove.first(html, "id", TextComparitor.EQ_CI_TRM, id);
-
peekElementById
public static TagNodeIndex peekElementById (java.util.Vector<HTMLNode> html, java.lang.String id)
Java-Script's Element by ID function retrieves all HTMLTagNode
Elements that have a specified CSSID
-Attribute.
Peek:
The elements / nodes themselves, along with theVector
-indices where the nodes were found / identified are both (simultaneously) returned together as a single data-class reference. This Java HTML Type is simply calledTagNodeIndex
. Remember, that class'TagNodeIndex'
implements theReplaceable
interface, making it an efficient List-Modification class.- Parameters:
html
- This may be any vectorized-html page, or sub-page.id
- This should be a valid HTML'ID'
Attribute-Value (inner-tag value). This is also known as a CSS-Style-Sheet'ID'
Tag.- Returns:
- A first
'TagNode'
element that matches the specified input-criteria, along with theVector
-index as an integer included in the'TagNodeIndex'
return-type.class 'TagNodeIndex'
includes both the'TagNode'
, and theVector
-index from whence it came. - Throws:
CSSStrException
- This exception will throw if theString
passed to the'id'
parameter is not a valid CSS'ID'
. Please review the ExceptionCSSStrException
to see what constitutes a valid CSS'ID'
.- See Also:
InnerTagPeek
- Code:
- Exact Method Body:
CSSStrException.check(id); return InnerTagPeek.first(html, "id", TextComparitor.EQ_CI_TRM, id);
-
pollElementById
public static TagNode pollElementById(java.util.Vector<HTMLNode> html, java.lang.String id)
Java-Script's Element by ID function retrieves all HTMLTagNode
Elements that have a specified CSSID
-Attribute.
Poll:
These operations simply behave like a combination of the'Get'
operation and the'Remove'
operation. In a'Poll'
styled method,HTMLNode's
are first removed, and afterwards, these removed nodes are put into a list and returned back to the invoking method.- Parameters:
html
- This may be any vectorized-html page, or sub-page.id
- This should be a valid HTML'ID'
Attribute-Value (inner-tag value). This is also known as a CSS-Style-Sheet'ID'
Tag.- Returns:
- The first HTML
TagNode
Element that matches the specified criteria. - Throws:
CSSStrException
- This exception will throw if theString
passed to the'id'
parameter is not a valid CSS'ID'
. Please review the ExceptionCSSStrException
to see what constitutes a valid CSS'ID'
.- See Also:
InnerTagPoll
- Code:
- Exact Method Body:
CSSStrException.check(id); return InnerTagPoll.first(html, "id", TextComparitor.EQ_CI_TRM, id);
-
findElementByIdInclusive
public static DotPair findElementByIdInclusive (java.util.Vector<HTMLNode> html, java.lang.String id)
Java-Script's Element by ID function retrieves all HTMLTagNode
Elements that have a specified CSSID
-Attribute.
Find:
These operations return the integerVector
-indices which point to nodes in the original html-Vector
that match the specified criteria.
Inclusive:
In this html search library, all the word 'inclusive' means, is that when an openingTagNode
is found by an 'inclusive method', before returning that node, the matching, and closing pair of thatTagNode
, along with allHTMLNode's
in-between, are included in the result.
This, effectively, means that'inclusive'
methods will always return either a complete Vectorized-HTML Sub-List, or aDotPair
instance instead. (DotPair's
are simply wrappers for a Starting-Index integer and an Ending-Index integer that mean to demarcate a Sub-List.
For instance, an HTML divider-element like<DIV class=someClass ...> ... </DIV>
as an 'inclusive return-value' that will likely have manyHTMLNode's
in that returned list.- Parameters:
html
- This may be any vectorized-html page, or sub-page.id
- This should be a valid HTML'ID'
Attribute-Value (inner-tag value). This is also known as a CSS-Style-Sheet'ID'
Tag.- Returns:
- Integer vector-index pointers, for a sublist, that match the specified input criteria.
- Throws:
CSSStrException
- This exception will throw if theString
passed to the'id'
parameter is not a valid CSS'ID'
. Please review the ExceptionCSSStrException
to see what constitutes a valid CSS'ID'
.- See Also:
InnerTagFindInclusive
- Code:
- Exact Method Body:
CSSStrException.check(id); return InnerTagFindInclusive.first (html, "id", TextComparitor.EQ_CI_TRM, id);
-
getElementByIdInclusive
public static java.util.Vector<HTMLNode> getElementByIdInclusive (java.util.Vector<HTMLNode> html, java.lang.String id)
Java-Script's Element by ID function retrieves all HTMLTagNode
Elements that have a specified CSSID
-Attribute.
Get:
These operations return the nodes that match the specified criteria.
Inclusive:
In this html search library, all the word 'inclusive' means, is that when an openingTagNode
is found by an 'inclusive method', before returning that node, the matching, and closing pair of thatTagNode
, along with allHTMLNode's
in-between, are included in the result.
This, effectively, means that'inclusive'
methods will always return either a complete Vectorized-HTML Sub-List, or aDotPair
instance instead. (DotPair's
are simply wrappers for a Starting-Index integer and an Ending-Index integer that mean to demarcate a Sub-List.
For instance, an HTML divider-element like<DIV class=someClass ...> ... </DIV>
as an 'inclusive return-value' that will likely have manyHTMLNode's
in that returned list.- Parameters:
html
- This may be any vectorized-html page, or sub-page.id
- This should be a valid HTML'ID'
Attribute-Value (inner-tag value). This is also known as a CSS-Style-Sheet'ID'
Tag.- Returns:
- The complete sub-list of
HTMLNode's
that match the specified input criteria. - Throws:
CSSStrException
- This exception will throw if theString
passed to the'id'
parameter is not a valid CSS'ID'
. Please review the ExceptionCSSStrException
to see what constitutes a valid CSS'ID'
.- See Also:
InnerTagGetInclusive
- Code:
- Exact Method Body:
CSSStrException.check(id); return InnerTagGetInclusive.first(html, "id", TextComparitor.EQ_CI_TRM, id);
-
removeElementByIdInclusive
public static int removeElementByIdInclusive (java.util.Vector<HTMLNode> html, java.lang.String id)
Java-Script's Element by ID function retrieves all HTMLTagNode
Elements that have a specified CSSID
-Attribute.
Remove:
These operations remove nodes that match the specified criteria, and then, afterwards, return an integer'count'
- informing the user how many nodes were actually removed.
Inclusive:
In this html search library, all the word 'inclusive' means, is that when an openingTagNode
is found by an 'inclusive method', before returning that node, the matching, and closing pair of thatTagNode
, along with allHTMLNode's
in-between, are included in the result.
This, effectively, means that'inclusive'
methods will always return either a complete Vectorized-HTML Sub-List, or aDotPair
instance instead. (DotPair's
are simply wrappers for a Starting-Index integer and an Ending-Index integer that mean to demarcate a Sub-List.
For instance, an HTML divider-element like<DIV class=someClass ...> ... </DIV>
as an 'inclusive return-value' that will likely have manyHTMLNode's
in that returned list.- Parameters:
html
- This may be any vectorized-html page, or sub-page.id
- This should be a valid HTML'ID'
Attribute-Value (inner-tag value). This is also known as a CSS-Style-Sheet'ID'
Tag.- Returns:
- The total number of HTML Nodes that were removed from the
input-
Vector 'html'
- Throws:
CSSStrException
- This exception will throw if theString
passed to the'id'
parameter is not a valid CSS'ID'
. Please review the ExceptionCSSStrException
to see what constitutes a valid CSS'ID'
.- See Also:
InnerTagRemoveInclusive
- Code:
- Exact Method Body:
CSSStrException.check(id); return InnerTagRemoveInclusive.first(html, "id", TextComparitor.EQ_CI_TRM, id);
-
peekElementByIdInclusive
public static SubSection peekElementByIdInclusive (java.util.Vector<HTMLNode> html, java.lang.String id)
Java-Script's Element by ID function retrieves all HTMLTagNode
Elements that have a specified CSSID
-Attribute.
Peek:
The elements / nodes themselves, along with theVector
-indices where they were found / identified are returned as a single data-Object
of typeSubSection
. ClassSubSection
and classTagNodeIndex
both implement theReplaceable
interface, meaning they can help improve the efficiency of large page-modification operations.
These two classes differ in that classSubSection
wraps an entire Sub-List, while classTagNodeIndex
only wraps a singleTagNode
. Both have their location / index & HTML-Content information encapsulated, together in a single reference - as do all classes which implementReplaceable
Inclusive:
In this html search library, all the word 'inclusive' means, is that when an openingTagNode
is found by an 'inclusive method', before returning that node, the matching, and closing pair of thatTagNode
, along with allHTMLNode's
in-between, are included in the result.
This, effectively, means that'inclusive'
methods will always return either a complete Vectorized-HTML Sub-List, or aDotPair
instance instead. (DotPair's
are simply wrappers for a Starting-Index integer and an Ending-Index integer that mean to demarcate a Sub-List.
For instance, an HTML divider-element like<DIV class=someClass ...> ... </DIV>
as an 'inclusive return-value' that will likely have manyHTMLNode's
in that returned list.- Parameters:
html
- This may be any vectorized-html page, or sub-page.id
- This should be a valid HTML'ID'
Attribute-Value (inner-tag value). This is also known as a CSS-Style-Sheet'ID'
Tag.- Returns:
- Instances of
'SubSection'
contain both the html sub-page as aVector
, and the matching'DotPair' Vector
index-pointer from the originalVector
from whence they came. - Throws:
CSSStrException
- This exception will throw if theString
passed to the'id'
parameter is not a valid CSS'ID'
. Please review the ExceptionCSSStrException
to see what constitutes a valid CSS'ID'
.- See Also:
InnerTagPeekInclusive
- Code:
- Exact Method Body:
CSSStrException.check(id); return InnerTagPeekInclusive.first(html, "id", TextComparitor.EQ_CI_TRM, id);
-
pollElementByIdInclusive
public static java.util.Vector<HTMLNode> pollElementByIdInclusive (java.util.Vector<HTMLNode> html, java.lang.String id)
Java-Script's Element by ID function retrieves all HTMLTagNode
Elements that have a specified CSSID
-Attribute.
Poll:
These operations simply behave like a combination of the'Get'
operation and the'Remove'
operation. In a'Poll'
styled method,HTMLNode's
are first removed, and afterwards, these removed nodes are put into a list and returned back to the invoking method.
Inclusive:
In this html search library, all the word 'inclusive' means, is that when an openingTagNode
is found by an 'inclusive method', before returning that node, the matching, and closing pair of thatTagNode
, along with allHTMLNode's
in-between, are included in the result.
This, effectively, means that'inclusive'
methods will always return either a complete Vectorized-HTML Sub-List, or aDotPair
instance instead. (DotPair's
are simply wrappers for a Starting-Index integer and an Ending-Index integer that mean to demarcate a Sub-List.
For instance, an HTML divider-element like<DIV class=someClass ...> ... </DIV>
as an 'inclusive return-value' that will likely have manyHTMLNode's
in that returned list.- Parameters:
html
- This may be any vectorized-html page, or sub-page.id
- This should be a valid HTML'ID'
Attribute-Value (inner-tag value). This is also known as a CSS-Style-Sheet'ID'
Tag.- Returns:
- The complete sub-list of
HTMLNode's
that match the specified input criteria. - Throws:
CSSStrException
- This exception will throw if theString
passed to the'id'
parameter is not a valid CSS'ID'
. Please review the ExceptionCSSStrException
to see what constitutes a valid CSS'ID'
.- See Also:
InnerTagPollInclusive
- Code:
- Exact Method Body:
CSSStrException.check(id); return InnerTagPollInclusive.first(html, "id", TextComparitor.EQ_CI_TRM, id);
-
countElementsByTagName
public static int countElementsByTagName(java.util.Vector<HTMLNode> html, java.lang.String htmlTok)
Java-Script's Elements by TagName function retrieves all HTMLTagNode
Elements having a certain "HTML Token." For instance, one could specify all'<DIV>'
elements, or all perhaps HTML anchor'<A HREF=...>'
elements by passing either theString
parameter"div"
or"a"
to this method.
Count:
These operations return a count on the number of matches of the specified criteria.- Parameters:
html
- This may be any vectorized-html page, or sub-page.htmlTok
- This is an HTML Element Token - also known as "The HTML Element Name." For instance:'DIV', 'SPAN', 'IMG',
etc...- Returns:
- The number of
'TagNode'
elements that match the specified input criteria. - Throws:
HTMLTokException
- This exception will be thrown byclass ARGCHECK
if the HTML Element Name provided is not a valid HTML Element.- See Also:
TagNodeCount
- Code:
- Exact Method Body:
return TagNodeCount.all(html, TC.OpeningTags, htmlTok);
-
findElementsByTagName
public static int[] findElementsByTagName(java.util.Vector<HTMLNode> html, java.lang.String htmlTok)
Java-Script's Elements by TagName function retrieves all HTMLTagNode
Elements having a certain "HTML Token." For instance, one could specify all'<DIV>'
elements, or all perhaps HTML anchor'<A HREF=...>'
elements by passing either theString
parameter"div"
or"a"
to this method.
Find:
These operations return the integerVector
-indices which point to nodes in the original html-Vector
that match the specified criteria.- Parameters:
html
- This may be any vectorized-html page, or sub-page.htmlTok
- This is an HTML Element Token - also known as "The HTML Element Name." For instance:'DIV', 'SPAN', 'IMG',
etc...- Returns:
- A list of integer vector-index pointers into the input vector parameter 'html.'
- Throws:
HTMLTokException
- This exception will be thrown byclass ARGCHECK
if the HTML Element Name provided is not a valid HTML Element.- See Also:
TagNodeFind
- Code:
- Exact Method Body:
return TagNodeFind.all(html, TC.OpeningTags, htmlTok);
-
getElementsByTagName
public static java.util.Vector<TagNode> getElementsByTagName (java.util.Vector<HTMLNode> html, java.lang.String htmlTok)
Java-Script's Elements by TagName function retrieves all HTMLTagNode
Elements having a certain "HTML Token." For instance, one could specify all'<DIV>'
elements, or all perhaps HTML anchor'<A HREF=...>'
elements by passing either theString
parameter"div"
or"a"
to this method.
Get:
These operations return the nodes that match the specified criteria.- Parameters:
html
- This may be any vectorized-html page, or sub-page.htmlTok
- This is an HTML Element Token - also known as "The HTML Element Name." For instance:'DIV', 'SPAN', 'IMG',
etc...- Returns:
- A list of all
'TagNode'
elements that match the specified input-criteria. - Throws:
HTMLTokException
- This exception will be thrown byclass ARGCHECK
if the HTML Element Name provided is not a valid HTML Element.- See Also:
TagNodeGet
- Code:
- Exact Method Body:
return TagNodeGet.all(html, TC.OpeningTags, htmlTok);
-
removeElementsByTagName
public static int removeElementsByTagName(java.util.Vector<HTMLNode> html, java.lang.String htmlTok)
Java-Script's Elements by TagName function retrieves all HTMLTagNode
Elements having a certain "HTML Token." For instance, one could specify all'<DIV>'
elements, or all perhaps HTML anchor'<A HREF=...>'
elements by passing either theString
parameter"div"
or"a"
to this method.
Remove:
These operations remove nodes that match the specified criteria, and then, afterwards, return an integer'count'
- informing the user how many nodes were actually removed.- Parameters:
html
- This may be any vectorized-html page, or sub-page.htmlTok
- This is an HTML Element Token - also known as "The HTML Element Name." For instance:'DIV', 'SPAN', 'IMG',
etc...- Returns:
- The total number of HTML Nodes that were removed from the input-
Vector 'html'
- Throws:
HTMLTokException
- This exception will be thrown byclass ARGCHECK
if the HTML Element Name provided is not a valid HTML Element.- See Also:
TagNodeRemove
- Code:
- Exact Method Body:
return TagNodeRemove.all(html, TC.OpeningTags, htmlTok);
-
peekElementsByTagName
public static java.util.Vector<TagNodeIndex> peekElementsByTagName (java.util.Vector<HTMLNode> html, java.lang.String htmlTok)
Java-Script's Elements by TagName function retrieves all HTMLTagNode
Elements having a certain "HTML Token." For instance, one could specify all'<DIV>'
elements, or all perhaps HTML anchor'<A HREF=...>'
elements by passing either theString
parameter"div"
or"a"
to this method.
Peek:
The elements / nodes themselves, along with theVector
-indices where the nodes were found / identified are both (simultaneously) returned together as a single data-class reference. This Java HTML Type is simply calledTagNodeIndex
. Remember, that class'TagNodeIndex'
implements theReplaceable
interface, making it an efficient List-Modification class.- Parameters:
html
- This may be any vectorized-html page, or sub-page.htmlTok
- This is an HTML Element Token - also known as "The HTML Element Name." For instance:'DIV', 'SPAN', 'IMG',
etc...- Returns:
- A list of all
'TagNode'
elements that match the specified input-criteria, along with theVector
-index as an integer included in the'TagNodeIndex'
return-type.class 'TagNodeIndex'
includes both the'TagNode'
, and theVector
-index from whence it came. - Throws:
HTMLTokException
- This exception will be thrown byclass ARGCHECK
if the HTML Element Name provided is not a valid HTML Element.- See Also:
TagNodePeek
- Code:
- Exact Method Body:
return TagNodePeek.all(html, TC.OpeningTags, htmlTok);
-
pollElementsByTagName
public static java.util.Vector<TagNode> pollElementsByTagName (java.util.Vector<HTMLNode> html, java.lang.String htmlTok)
Java-Script's Elements by TagName function retrieves all HTMLTagNode
Elements having a certain "HTML Token." For instance, one could specify all'<DIV>'
elements, or all perhaps HTML anchor'<A HREF=...>'
elements by passing either theString
parameter"div"
or"a"
to this method.
Poll:
These operations simply behave like a combination of the'Get'
operation and the'Remove'
operation. In a'Poll'
styled method,HTMLNode's
are first removed, and afterwards, these removed nodes are put into a list and returned back to the invoking method.- Parameters:
html
- This may be any vectorized-html page, or sub-page.htmlTok
- This is an HTML Element Token - also known as "The HTML Element Name." For instance:'DIV', 'SPAN', 'IMG',
etc...- Returns:
- A list of all
'TagNode'
elements that match the specified input-criteria. - Throws:
HTMLTokException
- This exception will be thrown byclass ARGCHECK
if the HTML Element Name provided is not a valid HTML Element.- See Also:
TagNodePoll
- Code:
- Exact Method Body:
return TagNodePoll.all(html, TC.OpeningTags, htmlTok);
-
findElementsByTagNameInclusive
public static java.util.Vector<DotPair> findElementsByTagNameInclusive (java.util.Vector<HTMLNode> html, java.lang.String htmlTok)
Java-Script's Elements by TagName function retrieves all HTMLTagNode
Elements having a certain "HTML Token." For instance, one could specify all'<DIV>'
elements, or all perhaps HTML anchor'<A HREF=...>'
elements by passing either theString
parameter"div"
or"a"
to this method.
Find:
These operations return the integerVector
-indices which point to nodes in the original html-Vector
that match the specified criteria.
Inclusive:
In this html search library, all the word 'inclusive' means, is that when an openingTagNode
is found by an 'inclusive method', before returning that node, the matching, and closing pair of thatTagNode
, along with allHTMLNode's
in-between, are included in the result.
This, effectively, means that'inclusive'
methods will always return either a complete Vectorized-HTML Sub-List, or aDotPair
instance instead. (DotPair's
are simply wrappers for a Starting-Index integer and an Ending-Index integer that mean to demarcate a Sub-List.
For instance, an HTML divider-element like<DIV class=someClass ...> ... </DIV>
as an 'inclusive return-value' that will likely have manyHTMLNode's
in that returned list.- Parameters:
html
- This may be any vectorized-html page, or sub-page.htmlTok
- This is an HTML Element Token - also known as "The HTML Element Name." For instance:'DIV', 'SPAN', 'IMG',
etc...- Returns:
- A "list of lists" where each
DotPair
element contains the starting and ending index-pointers (as integers, wrapped in a'DotPair'
instance) for each match of the input parameter criteria-specifications. - Throws:
HTMLTokException
- This exception will be thrown byclass ARGCHECK
if the HTML Element Name provided is not a valid HTML Element.- See Also:
TagNodeFindInclusive
- Code:
- Exact Method Body:
return TagNodeFindInclusive.all(html, htmlTok);
-
getElementsByTagNameInclusive
public static java.util.Vector<java.util.Vector<HTMLNode>> getElementsByTagNameInclusive (java.util.Vector<HTMLNode> html, java.lang.String htmlTok)
Java-Script's Elements by TagName function retrieves all HTMLTagNode
Elements having a certain "HTML Token." For instance, one could specify all'<DIV>'
elements, or all perhaps HTML anchor'<A HREF=...>'
elements by passing either theString
parameter"div"
or"a"
to this method.
Get:
These operations return the nodes that match the specified criteria.
Inclusive:
In this html search library, all the word 'inclusive' means, is that when an openingTagNode
is found by an 'inclusive method', before returning that node, the matching, and closing pair of thatTagNode
, along with allHTMLNode's
in-between, are included in the result.
This, effectively, means that'inclusive'
methods will always return either a complete Vectorized-HTML Sub-List, or aDotPair
instance instead. (DotPair's
are simply wrappers for a Starting-Index integer and an Ending-Index integer that mean to demarcate a Sub-List.
For instance, an HTML divider-element like<DIV class=someClass ...> ... </DIV>
as an 'inclusive return-value' that will likely have manyHTMLNode's
in that returned list.- Parameters:
html
- This may be any vectorized-html page, or sub-page.htmlTok
- This is an HTML Element Token - also known as "The HTML Element Name." For instance:'DIV', 'SPAN', 'IMG',
etc...- Returns:
- A "list of lists" for each opening and closing HTML Element match.
- Throws:
HTMLTokException
- This exception will be thrown byclass ARGCHECK
if the HTML Element Name provided is not a valid HTML Element.- See Also:
TagNodeGetInclusive
- Code:
- Exact Method Body:
return TagNodeGetInclusive.all(html, htmlTok);
-
removeElementsByTagNameInclusive
public static int removeElementsByTagNameInclusive (java.util.Vector<HTMLNode> html, java.lang.String htmlTok)
Java-Script's Elements by TagName function retrieves all HTMLTagNode
Elements having a certain "HTML Token." For instance, one could specify all'<DIV>'
elements, or all perhaps HTML anchor'<A HREF=...>'
elements by passing either theString
parameter"div"
or"a"
to this method.
Remove:
These operations remove nodes that match the specified criteria, and then, afterwards, return an integer'count'
- informing the user how many nodes were actually removed.
Inclusive:
In this html search library, all the word 'inclusive' means, is that when an openingTagNode
is found by an 'inclusive method', before returning that node, the matching, and closing pair of thatTagNode
, along with allHTMLNode's
in-between, are included in the result.
This, effectively, means that'inclusive'
methods will always return either a complete Vectorized-HTML Sub-List, or aDotPair
instance instead. (DotPair's
are simply wrappers for a Starting-Index integer and an Ending-Index integer that mean to demarcate a Sub-List.
For instance, an HTML divider-element like<DIV class=someClass ...> ... </DIV>
as an 'inclusive return-value' that will likely have manyHTMLNode's
in that returned list.- Parameters:
html
- This may be any vectorized-html page, or sub-page.htmlTok
- This is an HTML Element Token - also known as "The HTML Element Name." For instance:'DIV', 'SPAN', 'IMG',
etc...- Returns:
- The total number of HTML Nodes that were removed from the
input-
Vector 'html'
- Throws:
HTMLTokException
- This exception will be thrown byclass ARGCHECK
if the HTML Element Name provided is not a valid HTML Element.- See Also:
TagNodeRemoveInclusive
- Code:
- Exact Method Body:
return TagNodeRemoveInclusive.all(html, htmlTok);
-
peekElementsByTagNameInclusive
public static java.util.Vector<SubSection> peekElementsByTagNameInclusive (java.util.Vector<HTMLNode> html, java.lang.String htmlTok)
Java-Script's Elements by TagName function retrieves all HTMLTagNode
Elements having a certain "HTML Token." For instance, one could specify all'<DIV>'
elements, or all perhaps HTML anchor'<A HREF=...>'
elements by passing either theString
parameter"div"
or"a"
to this method.
Peek:
The elements / nodes themselves, along with theVector
-indices where they were found / identified are returned as a single data-Object
of typeSubSection
. ClassSubSection
and classTagNodeIndex
both implement theReplaceable
interface, meaning they can help improve the efficiency of large page-modification operations.
These two classes differ in that classSubSection
wraps an entire Sub-List, while classTagNodeIndex
only wraps a singleTagNode
. Both have their location / index & HTML-Content information encapsulated, together in a single reference - as do all classes which implementReplaceable
Inclusive:
In this html search library, all the word 'inclusive' means, is that when an openingTagNode
is found by an 'inclusive method', before returning that node, the matching, and closing pair of thatTagNode
, along with allHTMLNode's
in-between, are included in the result.
This, effectively, means that'inclusive'
methods will always return either a complete Vectorized-HTML Sub-List, or aDotPair
instance instead. (DotPair's
are simply wrappers for a Starting-Index integer and an Ending-Index integer that mean to demarcate a Sub-List.
For instance, an HTML divider-element like<DIV class=someClass ...> ... </DIV>
as an 'inclusive return-value' that will likely have manyHTMLNode's
in that returned list.- Parameters:
html
- This may be any vectorized-html page, or sub-page.htmlTok
- This is an HTML Element Token - also known as "The HTML Element Name." For instance:'DIV', 'SPAN', 'IMG',
etc...- Returns:
- A "list of lists" for each opening and closing HTML Element match. Instances
of
'SubSection'
contain both the html sub-page as aVector
, and the matching'DotPair' Vector
index-pointer from the originalVector
from whence they came. - Throws:
HTMLTokException
- This exception will be thrown byclass ARGCHECK
if the HTML Element Name provided is not a valid HTML Element.- See Also:
TagNodePeekInclusive
- Code:
- Exact Method Body:
return TagNodePeekInclusive.all(html, htmlTok);
-
pollElementsByTagNameInclusive
public static java.util.Vector<java.util.Vector<HTMLNode>> pollElementsByTagNameInclusive (java.util.Vector<HTMLNode> html, java.lang.String htmlTok)
Java-Script's Elements by TagName function retrieves all HTMLTagNode
Elements having a certain "HTML Token." For instance, one could specify all'<DIV>'
elements, or all perhaps HTML anchor'<A HREF=...>'
elements by passing either theString
parameter"div"
or"a"
to this method.
Poll:
These operations simply behave like a combination of the'Get'
operation and the'Remove'
operation. In a'Poll'
styled method,HTMLNode's
are first removed, and afterwards, these removed nodes are put into a list and returned back to the invoking method.
Inclusive:
In this html search library, all the word 'inclusive' means, is that when an openingTagNode
is found by an 'inclusive method', before returning that node, the matching, and closing pair of thatTagNode
, along with allHTMLNode's
in-between, are included in the result.
This, effectively, means that'inclusive'
methods will always return either a complete Vectorized-HTML Sub-List, or aDotPair
instance instead. (DotPair's
are simply wrappers for a Starting-Index integer and an Ending-Index integer that mean to demarcate a Sub-List.
For instance, an HTML divider-element like<DIV class=someClass ...> ... </DIV>
as an 'inclusive return-value' that will likely have manyHTMLNode's
in that returned list.- Parameters:
html
- This may be any vectorized-html page, or sub-page.htmlTok
- This is an HTML Element Token - also known as "The HTML Element Name." For instance:'DIV', 'SPAN', 'IMG',
etc...- Returns:
- A "list of lists" for each opening and closing HTML Element match.
- Throws:
HTMLTokException
- This exception will be thrown byclass ARGCHECK
if the HTML Element Name provided is not a valid HTML Element.- See Also:
TagNodePollInclusive
- Code:
- Exact Method Body:
return TagNodePollInclusive.all(html, htmlTok);
-
countElementsByClassName
public static int countElementsByClassName (java.util.Vector<HTMLNode> html, java.lang.String className)
Java-Script's Elements by Class Name function retrieves all HTMLTagNode
Elements that are tagged with a specified CSS-Class
Count:
These operations return a count on the number of matches of the specified criteria.- Parameters:
html
- This may be any vectorized-html page, or sub-page.className
- This should be a valid HTML CSS'CLASS'
Attribute-Value (inner-tag value).- Returns:
- The number of
'TagNode'
elements that match the specified input criteria. - Throws:
CSSStrException
- Whenever theTextComparitor's
for CSS'Classes'
are used, passed or invoked, the'class-name'
, or list ofclass-name's
(asString's
) provided to theTextComparitor
will be checked for validity according to CSS naming conventions. If parameter'className'
does not meet the strict requirements for CSSClass-Names
, this exception will throw immediately.- See Also:
InnerTagCount
- Code:
- Exact Method Body:
return InnerTagCount.all(html, "class", TextComparitor.C, className);
-
findElementsByClassName
public static int[] findElementsByClassName (java.util.Vector<HTMLNode> html, java.lang.String className)
Java-Script's Elements by Class Name function retrieves all HTMLTagNode
Elements that are tagged with a specified CSS-Class
Find:
These operations return the integerVector
-indices which point to nodes in the original html-Vector
that match the specified criteria.- Parameters:
html
- This may be any vectorized-html page, or sub-page.className
- This should be a valid HTML CSS'CLASS'
Attribute-Value (inner-tag value).- Returns:
- A list of integer vector-index pointers into the input vector parameter 'html.'
- Throws:
CSSStrException
- Whenever theTextComparitor's
for CSS'Classes'
are used, passed or invoked, the'class-name'
, or list ofclass-name's
(asString's
) provided to theTextComparitor
will be checked for validity according to CSS naming conventions. If parameter'className'
does not meet the strict requirements for CSSClass-Names
, this exception will throw immediately.- See Also:
InnerTagFind
- Code:
- Exact Method Body:
return InnerTagFind.all(html, "class", TextComparitor.C, className);
-
getElementsByClassName
public static java.util.Vector<TagNode> getElementsByClassName (java.util.Vector<HTMLNode> html, java.lang.String className)
Java-Script's Elements by Class Name function retrieves all HTMLTagNode
Elements that are tagged with a specified CSS-Class
Get:
These operations return the nodes that match the specified criteria.- Parameters:
html
- This may be any vectorized-html page, or sub-page.className
- This should be a valid HTML CSS'CLASS'
Attribute-Value (inner-tag value).- Returns:
- A list of all
'TagNode'
elements that match the specified input-criteria. - Throws:
CSSStrException
- Whenever theTextComparitor's
for CSS'Classes'
are used, passed or invoked, the'class-name'
, or list ofclass-name's
(asString's
) provided to theTextComparitor
will be checked for validity according to CSS naming conventions. If parameter'className'
does not meet the strict requirements for CSSClass-Names
, this exception will throw immediately.- See Also:
InnerTagGet
- Code:
- Exact Method Body:
return InnerTagGet.all(html, "class", TextComparitor.C, className);
-
removeElementsByClassName
public static int removeElementsByClassName (java.util.Vector<HTMLNode> html, java.lang.String className)
Java-Script's Elements by Class Name function retrieves all HTMLTagNode
Elements that are tagged with a specified CSS-Class
Remove:
These operations remove nodes that match the specified criteria, and then, afterwards, return an integer'count'
- informing the user how many nodes were actually removed.- Parameters:
html
- This may be any vectorized-html page, or sub-page.className
- This should be a valid HTML CSS'CLASS'
Attribute-Value (inner-tag value).- Returns:
- The total number of HTML Nodes that were removed from the
input-
Vector 'html'
- Throws:
CSSStrException
- Whenever theTextComparitor's
for CSS'Classes'
are used, passed or invoked, the'class-name'
, or list ofclass-name's
(asString's
) provided to theTextComparitor
will be checked for validity according to CSS naming conventions. If parameter'className'
does not meet the strict requirements for CSSClass-Names
, this exception will throw immediately.- See Also:
InnerTagRemove
- Code:
- Exact Method Body:
return InnerTagRemove.all(html, "class", TextComparitor.C, className);
-
peekElementsByClassName
public static java.util.Vector<TagNodeIndex> peekElementsByClassName (java.util.Vector<HTMLNode> html, java.lang.String className)
Java-Script's Elements by Class Name function retrieves all HTMLTagNode
Elements that are tagged with a specified CSS-Class
Peek:
The elements / nodes themselves, along with theVector
-indices where the nodes were found / identified are both (simultaneously) returned together as a single data-class reference. This Java HTML Type is simply calledTagNodeIndex
. Remember, that class'TagNodeIndex'
implements theReplaceable
interface, making it an efficient List-Modification class.- Parameters:
html
- This may be any vectorized-html page, or sub-page.className
- This should be a valid HTML CSS'CLASS'
Attribute-Value (inner-tag value).- Returns:
- A list of all
'TagNode'
elements that match the specified input-criteria, along with theVector
-index as an integer included in the'TagNodeIndex'
return-type.class 'TagNodeIndex'
includes both the'TagNode'
, and theVector
-index from whence it came. - Throws:
CSSStrException
- Whenever theTextComparitor's
for CSS'Classes'
are used, passed or invoked, the'class-name'
, or list ofclass-name's
(asString's
) provided to theTextComparitor
will be checked for validity according to CSS naming conventions. If parameter'className'
does not meet the strict requirements for CSSClass-Names
, this exception will throw immediately.- See Also:
InnerTagPeek
- Code:
- Exact Method Body:
return InnerTagPeek.all(html, "class", TextComparitor.C, className);
-
pollElementsByClassName
public static java.util.Vector<TagNode> pollElementsByClassName (java.util.Vector<HTMLNode> html, java.lang.String className)
Java-Script's Elements by Class Name function retrieves all HTMLTagNode
Elements that are tagged with a specified CSS-Class
Poll:
These operations simply behave like a combination of the'Get'
operation and the'Remove'
operation. In a'Poll'
styled method,HTMLNode's
are first removed, and afterwards, these removed nodes are put into a list and returned back to the invoking method.- Parameters:
html
- This may be any vectorized-html page, or sub-page.className
- This should be a valid HTML CSS'CLASS'
Attribute-Value (inner-tag value).- Returns:
- A list of all
'TagNode'
elements that match the specified input-criteria. - Throws:
CSSStrException
- Whenever theTextComparitor's
for CSS'Classes'
are used, passed or invoked, the'class-name'
, or list ofclass-name's
(asString's
) provided to theTextComparitor
will be checked for validity according to CSS naming conventions. If parameter'className'
does not meet the strict requirements for CSSClass-Names
, this exception will throw immediately.- See Also:
InnerTagPoll
- Code:
- Exact Method Body:
return InnerTagPoll.all(html, "class", TextComparitor.C, className);
-
findElementsByClassNameInclusive
public static java.util.Vector<DotPair> findElementsByClassNameInclusive (java.util.Vector<HTMLNode> html, java.lang.String className)
Java-Script's Elements by Class Name function retrieves all HTMLTagNode
Elements that are tagged with a specified CSS-Class
Find:
These operations return the integerVector
-indices which point to nodes in the original html-Vector
that match the specified criteria.
Inclusive:
In this html search library, all the word 'inclusive' means, is that when an openingTagNode
is found by an 'inclusive method', before returning that node, the matching, and closing pair of thatTagNode
, along with allHTMLNode's
in-between, are included in the result.
This, effectively, means that'inclusive'
methods will always return either a complete Vectorized-HTML Sub-List, or aDotPair
instance instead. (DotPair's
are simply wrappers for a Starting-Index integer and an Ending-Index integer that mean to demarcate a Sub-List.
For instance, an HTML divider-element like<DIV class=someClass ...> ... </DIV>
as an 'inclusive return-value' that will likely have manyHTMLNode's
in that returned list.- Parameters:
html
- This may be any vectorized-html page, or sub-page.className
- This should be a valid HTML CSS'CLASS'
Attribute-Value (inner-tag value).- Returns:
- A "list of lists" where each
DotPair
element contains the starting and ending index-pointers (as integers, wrapped in a'DotPair'
instance) for each match of the input parameter criteria-specifications. - Throws:
CSSStrException
- Whenever theTextComparitor's
for CSS'Classes'
are used, passed or invoked, the'class-name'
, or list ofclass-name's
(asString's
) provided to theTextComparitor
will be checked for validity according to CSS naming conventions. If parameter'className'
does not meet the strict requirements for CSSClass-Names
, this exception will throw immediately.- See Also:
InnerTagFindInclusive
- Code:
- Exact Method Body:
return InnerTagFindInclusive.all(html, "class", TextComparitor.C, className);
-
getElementsByClassNameInclusive
public static java.util.Vector<java.util.Vector<HTMLNode>> getElementsByClassNameInclusive (java.util.Vector<HTMLNode> html, java.lang.String className)
Java-Script's Elements by Class Name function retrieves all HTMLTagNode
Elements that are tagged with a specified CSS-Class
Get:
These operations return the nodes that match the specified criteria.
Inclusive:
In this html search library, all the word 'inclusive' means, is that when an openingTagNode
is found by an 'inclusive method', before returning that node, the matching, and closing pair of thatTagNode
, along with allHTMLNode's
in-between, are included in the result.
This, effectively, means that'inclusive'
methods will always return either a complete Vectorized-HTML Sub-List, or aDotPair
instance instead. (DotPair's
are simply wrappers for a Starting-Index integer and an Ending-Index integer that mean to demarcate a Sub-List.
For instance, an HTML divider-element like<DIV class=someClass ...> ... </DIV>
as an 'inclusive return-value' that will likely have manyHTMLNode's
in that returned list.- Parameters:
html
- This may be any vectorized-html page, or sub-page.className
- This should be a valid HTML CSS'CLASS'
Attribute-Value (inner-tag value).- Returns:
- A "list of lists" for each opening and closing HTML Element match.
- Throws:
CSSStrException
- Whenever theTextComparitor's
for CSS'Classes'
are used, passed or invoked, the'class-name'
, or list ofclass-name's
(asString's
) provided to theTextComparitor
will be checked for validity according to CSS naming conventions. If parameter'className'
does not meet the strict requirements for CSSClass-Names
, this exception will throw immediately.- See Also:
InnerTagGetInclusive
- Code:
- Exact Method Body:
return InnerTagGetInclusive.all(html, "class", TextComparitor.C, className);
-
removeElementsByClassNameInclusive
public static int removeElementsByClassNameInclusive (java.util.Vector<HTMLNode> html, java.lang.String className)
Java-Script's Elements by Class Name function retrieves all HTMLTagNode
Elements that are tagged with a specified CSS-Class
Remove:
These operations remove nodes that match the specified criteria, and then, afterwards, return an integer'count'
- informing the user how many nodes were actually removed.
Inclusive:
In this html search library, all the word 'inclusive' means, is that when an openingTagNode
is found by an 'inclusive method', before returning that node, the matching, and closing pair of thatTagNode
, along with allHTMLNode's
in-between, are included in the result.
This, effectively, means that'inclusive'
methods will always return either a complete Vectorized-HTML Sub-List, or aDotPair
instance instead. (DotPair's
are simply wrappers for a Starting-Index integer and an Ending-Index integer that mean to demarcate a Sub-List.
For instance, an HTML divider-element like<DIV class=someClass ...> ... </DIV>
as an 'inclusive return-value' that will likely have manyHTMLNode's
in that returned list.- Parameters:
html
- This may be any vectorized-html page, or sub-page.className
- This should be a valid HTML CSS'CLASS'
Attribute-Value (inner-tag value).- Returns:
- The total number of HTML Nodes that were removed from the
input-
Vector 'html'
- Throws:
CSSStrException
- Whenever theTextComparitor's
for CSS'Classes'
are used, passed or invoked, the'class-name'
, or list ofclass-name's
(asString's
) provided to theTextComparitor
will be checked for validity according to CSS naming conventions. If parameter'className'
does not meet the strict requirements for CSSClass-Names
, this exception will throw immediately.- See Also:
InnerTagRemoveInclusive
- Code:
- Exact Method Body:
return InnerTagRemoveInclusive.all(html, "class", TextComparitor.C, className);
-
peekElementsByClassNameInclusive
public static java.util.Vector<SubSection> peekElementsByClassNameInclusive (java.util.Vector<HTMLNode> html, java.lang.String className)
Java-Script's Elements by Class Name function retrieves all HTMLTagNode
Elements that are tagged with a specified CSS-Class
Peek:
The elements / nodes themselves, along with theVector
-indices where they were found / identified are returned as a single data-Object
of typeSubSection
. ClassSubSection
and classTagNodeIndex
both implement theReplaceable
interface, meaning they can help improve the efficiency of large page-modification operations.
These two classes differ in that classSubSection
wraps an entire Sub-List, while classTagNodeIndex
only wraps a singleTagNode
. Both have their location / index & HTML-Content information encapsulated, together in a single reference - as do all classes which implementReplaceable
Inclusive:
In this html search library, all the word 'inclusive' means, is that when an openingTagNode
is found by an 'inclusive method', before returning that node, the matching, and closing pair of thatTagNode
, along with allHTMLNode's
in-between, are included in the result.
This, effectively, means that'inclusive'
methods will always return either a complete Vectorized-HTML Sub-List, or aDotPair
instance instead. (DotPair's
are simply wrappers for a Starting-Index integer and an Ending-Index integer that mean to demarcate a Sub-List.
For instance, an HTML divider-element like<DIV class=someClass ...> ... </DIV>
as an 'inclusive return-value' that will likely have manyHTMLNode's
in that returned list.- Parameters:
html
- This may be any vectorized-html page, or sub-page.className
- This should be a valid HTML CSS'CLASS'
Attribute-Value (inner-tag value).- Returns:
- A "list of lists" for each opening and closing HTML Element match. Instances of
"SubSection" contain both the html sub-page as a vector, and the matching
DotPair Vector
index-pointer from the originalVector
from whence they came. - Throws:
CSSStrException
- Whenever theTextComparitor's
for CSS'Classes'
are used, passed or invoked, the'class-name'
, or list ofclass-name's
(asString's
) provided to theTextComparitor
will be checked for validity according to CSS naming conventions. If parameter'className'
does not meet the strict requirements for CSSClass-Names
, this exception will throw immediately.- See Also:
InnerTagPeekInclusive
- Code:
- Exact Method Body:
return InnerTagPeekInclusive.all(html, "class", TextComparitor.C, className);
-
pollElementsByClassNameInclusive
public static java.util.Vector<java.util.Vector<HTMLNode>> pollElementsByClassNameInclusive (java.util.Vector<HTMLNode> html, java.lang.String className)
Java-Script's Elements by Class Name function retrieves all HTMLTagNode
Elements that are tagged with a specified CSS-Class
Poll:
These operations simply behave like a combination of the'Get'
operation and the'Remove'
operation. In a'Poll'
styled method,HTMLNode's
are first removed, and afterwards, these removed nodes are put into a list and returned back to the invoking method.
Inclusive:
In this html search library, all the word 'inclusive' means, is that when an openingTagNode
is found by an 'inclusive method', before returning that node, the matching, and closing pair of thatTagNode
, along with allHTMLNode's
in-between, are included in the result.
This, effectively, means that'inclusive'
methods will always return either a complete Vectorized-HTML Sub-List, or aDotPair
instance instead. (DotPair's
are simply wrappers for a Starting-Index integer and an Ending-Index integer that mean to demarcate a Sub-List.
For instance, an HTML divider-element like<DIV class=someClass ...> ... </DIV>
as an 'inclusive return-value' that will likely have manyHTMLNode's
in that returned list.- Parameters:
html
- This may be any vectorized-html page, or sub-page.className
- This should be a valid HTML CSS'CLASS'
Attribute-Value (inner-tag value).- Returns:
- A "list of lists" for each opening and closing HTML Element match.
- Throws:
CSSStrException
- Whenever theTextComparitor's
for CSS'Classes'
are used, passed or invoked, the'class-name'
, or list ofclass-name's
(asString's
) provided to theTextComparitor
will be checked for validity according to CSS naming conventions. If parameter'className'
does not meet the strict requirements for CSSClass-Names
, this exception will throw immediately.- See Also:
InnerTagPollInclusive
- Code:
- Exact Method Body:
return InnerTagPollInclusive.all(html, "class", TextComparitor.C, className);
-
countElementsByName
public static int countElementsByName(java.util.Vector<HTMLNode> html, java.lang.String name)
Java-Script's Elements by Name function retrieves all HTML Elements whoseNAME
-Attribute which matches a givenname
parameter.
Count:
These operations return a count on the number of matches of the specified criteria.- Parameters:
html
- This may be any vectorized-html page, or sub-page.name
- This should be a valid HTML'NAME'
Attribute- Value (inner-tag value). This a "pre-HTML-5" used tag, that has been largely deprecated, and subsequently replaced by the'ID'
and'CLASS'
CSS-Attributes.- Returns:
- The number of
'TagNode'
elements that match the specified input criteria. - See Also:
InnerTagCount
- Code:
- Exact Method Body:
return InnerTagCount.all(html, "name", TextComparitor.EQ_CI_TRM, name);
-
findElementsByName
public static int[] findElementsByName(java.util.Vector<HTMLNode> html, java.lang.String name)
Java-Script's Elements by Name function retrieves all HTML Elements whoseNAME
-Attribute which matches a givenname
parameter.
Find:
These operations return the integerVector
-indices which point to nodes in the original html-Vector
that match the specified criteria.- Parameters:
html
- This may be any vectorized-html page, or sub-page.name
- This should be a valid HTML'NAME'
Attribute- Value (inner-tag value). This a "pre-HTML-5" used tag, that has been largely deprecated, and subsequently replaced by the'ID'
and'CLASS'
CSS-Attributes.- Returns:
- A list of integer vector-index pointers into the input vector parameter 'html.'
- See Also:
InnerTagFind
- Code:
- Exact Method Body:
return InnerTagFind.all(html, "name", TextComparitor.EQ_CI_TRM, name);
-
getElementsByName
public static java.util.Vector<TagNode> getElementsByName (java.util.Vector<HTMLNode> html, java.lang.String name)
Java-Script's Elements by Name function retrieves all HTML Elements whoseNAME
-Attribute which matches a givenname
parameter.
Get:
These operations return the nodes that match the specified criteria.- Parameters:
html
- This may be any vectorized-html page, or sub-page.name
- This should be a valid HTML'NAME'
Attribute- Value (inner-tag value). This a "pre-HTML-5" used tag, that has been largely deprecated, and subsequently replaced by the'ID'
and'CLASS'
CSS-Attributes.- Returns:
- A list of all
'TagNode'
elements that match the specified input-criteria. - See Also:
InnerTagGet
- Code:
- Exact Method Body:
return InnerTagGet.all(html, "name", TextComparitor.EQ_CI_TRM, name);
-
removeElementsByName
public static int removeElementsByName(java.util.Vector<HTMLNode> html, java.lang.String name)
Java-Script's Elements by Name function retrieves all HTML Elements whoseNAME
-Attribute which matches a givenname
parameter.
Remove:
These operations remove nodes that match the specified criteria, and then, afterwards, return an integer'count'
- informing the user how many nodes were actually removed.- Parameters:
html
- This may be any vectorized-html page, or sub-page.name
- This should be a valid HTML'NAME'
Attribute- Value (inner-tag value). This a "pre-HTML-5" used tag, that has been largely deprecated, and subsequently replaced by the'ID'
and'CLASS'
CSS-Attributes.- Returns:
- The total number of HTML Nodes that were removed from the
input-
Vector 'html'
- See Also:
InnerTagRemove
- Code:
- Exact Method Body:
return InnerTagRemove.all(html, "name", TextComparitor.EQ_CI_TRM, name);
-
peekElementsByName
public static java.util.Vector<TagNodeIndex> peekElementsByName (java.util.Vector<HTMLNode> html, java.lang.String name)
Java-Script's Elements by Name function retrieves all HTML Elements whoseNAME
-Attribute which matches a givenname
parameter.
Peek:
The elements / nodes themselves, along with theVector
-indices where the nodes were found / identified are both (simultaneously) returned together as a single data-class reference. This Java HTML Type is simply calledTagNodeIndex
. Remember, that class'TagNodeIndex'
implements theReplaceable
interface, making it an efficient List-Modification class.- Parameters:
html
- This may be any vectorized-html page, or sub-page.name
- This should be a valid HTML'NAME'
Attribute- Value (inner-tag value). This a "pre-HTML-5" used tag, that has been largely deprecated, and subsequently replaced by the'ID'
and'CLASS'
CSS-Attributes.- Returns:
- A list of all
'TagNode'
elements that match the specified input-criteria, along with theVector
-index as an integer included in the'TagNodeIndex'
return-type.class 'TagNodeIndex'
includes both the'TagNode'
, and theVector
-index from whence it came. - See Also:
InnerTagPeek
- Code:
- Exact Method Body:
return InnerTagPeek.all(html, "name", TextComparitor.EQ_CI_TRM, name);
-
pollElementsByName
public static java.util.Vector<TagNode> pollElementsByName (java.util.Vector<HTMLNode> html, java.lang.String name)
Java-Script's Elements by Name function retrieves all HTML Elements whoseNAME
-Attribute which matches a givenname
parameter.
Poll:
These operations simply behave like a combination of the'Get'
operation and the'Remove'
operation. In a'Poll'
styled method,HTMLNode's
are first removed, and afterwards, these removed nodes are put into a list and returned back to the invoking method.- Parameters:
html
- This may be any vectorized-html page, or sub-page.name
- This should be a valid HTML'NAME'
Attribute- Value (inner-tag value). This a "pre-HTML-5" used tag, that has been largely deprecated, and subsequently replaced by the'ID'
and'CLASS'
CSS-Attributes.- Returns:
- A list of all
'TagNode'
elements that match the specified input-criteria. - See Also:
InnerTagPoll
- Code:
- Exact Method Body:
return InnerTagPoll.all(html, "name", TextComparitor.EQ_CI_TRM, name);
-
findElementsByNameInclusive
public static java.util.Vector<DotPair> findElementsByNameInclusive (java.util.Vector<HTMLNode> html, java.lang.String name)
Java-Script's Elements by Name function retrieves all HTML Elements whoseNAME
-Attribute which matches a givenname
parameter.
Find:
These operations return the integerVector
-indices which point to nodes in the original html-Vector
that match the specified criteria.
Inclusive:
In this html search library, all the word 'inclusive' means, is that when an openingTagNode
is found by an 'inclusive method', before returning that node, the matching, and closing pair of thatTagNode
, along with allHTMLNode's
in-between, are included in the result.
This, effectively, means that'inclusive'
methods will always return either a complete Vectorized-HTML Sub-List, or aDotPair
instance instead. (DotPair's
are simply wrappers for a Starting-Index integer and an Ending-Index integer that mean to demarcate a Sub-List.
For instance, an HTML divider-element like<DIV class=someClass ...> ... </DIV>
as an 'inclusive return-value' that will likely have manyHTMLNode's
in that returned list.- Parameters:
html
- This may be any vectorized-html page, or sub-page.name
- This should be a valid HTML'NAME'
Attribute- Value (inner-tag value). This a "pre-HTML-5" used tag, that has been largely deprecated, and subsequently replaced by the'ID'
and'CLASS'
CSS-Attributes.- Returns:
- A "list of lists" where each
DotPair
element contains the starting and ending index-pointers (as integers, wrapped in a'DotPair'
instance) for each match of the input parameter criteria-specifications. - See Also:
InnerTagFindInclusive
- Code:
- Exact Method Body:
return InnerTagFindInclusive.all(html, "name", TextComparitor.EQ_CI_TRM, name);
-
getElementsByNameInclusive
public static java.util.Vector<java.util.Vector<HTMLNode>> getElementsByNameInclusive (java.util.Vector<HTMLNode> html, java.lang.String name)
Java-Script's Elements by Name function retrieves all HTML Elements whoseNAME
-Attribute which matches a givenname
parameter.
Get:
These operations return the nodes that match the specified criteria.
Inclusive:
In this html search library, all the word 'inclusive' means, is that when an openingTagNode
is found by an 'inclusive method', before returning that node, the matching, and closing pair of thatTagNode
, along with allHTMLNode's
in-between, are included in the result.
This, effectively, means that'inclusive'
methods will always return either a complete Vectorized-HTML Sub-List, or aDotPair
instance instead. (DotPair's
are simply wrappers for a Starting-Index integer and an Ending-Index integer that mean to demarcate a Sub-List.
For instance, an HTML divider-element like<DIV class=someClass ...> ... </DIV>
as an 'inclusive return-value' that will likely have manyHTMLNode's
in that returned list.- Parameters:
html
- This may be any vectorized-html page, or sub-page.name
- This should be a valid HTML'NAME'
Attribute- Value (inner-tag value). This a "pre-HTML-5" used tag, that has been largely deprecated, and subsequently replaced by the'ID'
and'CLASS'
CSS-Attributes.- Returns:
- A "list of lists" for each opening and closing HTML Element match.
- See Also:
InnerTagGetInclusive
- Code:
- Exact Method Body:
return InnerTagGetInclusive.all(html, "name", TextComparitor.EQ_CI_TRM, name);
-
removeElementsByNameInclusive
public static int removeElementsByNameInclusive (java.util.Vector<HTMLNode> html, java.lang.String name)
Java-Script's Elements by Name function retrieves all HTML Elements whoseNAME
-Attribute which matches a givenname
parameter.
Remove:
These operations remove nodes that match the specified criteria, and then, afterwards, return an integer'count'
- informing the user how many nodes were actually removed.
Inclusive:
In this html search library, all the word 'inclusive' means, is that when an openingTagNode
is found by an 'inclusive method', before returning that node, the matching, and closing pair of thatTagNode
, along with allHTMLNode's
in-between, are included in the result.
This, effectively, means that'inclusive'
methods will always return either a complete Vectorized-HTML Sub-List, or aDotPair
instance instead. (DotPair's
are simply wrappers for a Starting-Index integer and an Ending-Index integer that mean to demarcate a Sub-List.
For instance, an HTML divider-element like<DIV class=someClass ...> ... </DIV>
as an 'inclusive return-value' that will likely have manyHTMLNode's
in that returned list.- Parameters:
html
- This may be any vectorized-html page, or sub-page.name
- This should be a valid HTML'NAME'
Attribute- Value (inner-tag value). This a "pre-HTML-5" used tag, that has been largely deprecated, and subsequently replaced by the'ID'
and'CLASS'
CSS-Attributes.- Returns:
- The total number of HTML Nodes that were removed from the
input-
Vector 'html'
- See Also:
InnerTagRemoveInclusive
- Code:
- Exact Method Body:
return InnerTagRemoveInclusive.all(html, "name", TextComparitor.EQ_CI_TRM, name);
-
peekElementsByNameInclusive
public static java.util.Vector<SubSection> peekElementsByNameInclusive (java.util.Vector<HTMLNode> html, java.lang.String name)
Java-Script's Elements by Name function retrieves all HTML Elements whoseNAME
-Attribute which matches a givenname
parameter.
Peek:
The elements / nodes themselves, along with theVector
-indices where they were found / identified are returned as a single data-Object
of typeSubSection
. ClassSubSection
and classTagNodeIndex
both implement theReplaceable
interface, meaning they can help improve the efficiency of large page-modification operations.
These two classes differ in that classSubSection
wraps an entire Sub-List, while classTagNodeIndex
only wraps a singleTagNode
. Both have their location / index & HTML-Content information encapsulated, together in a single reference - as do all classes which implementReplaceable
Inclusive:
In this html search library, all the word 'inclusive' means, is that when an openingTagNode
is found by an 'inclusive method', before returning that node, the matching, and closing pair of thatTagNode
, along with allHTMLNode's
in-between, are included in the result.
This, effectively, means that'inclusive'
methods will always return either a complete Vectorized-HTML Sub-List, or aDotPair
instance instead. (DotPair's
are simply wrappers for a Starting-Index integer and an Ending-Index integer that mean to demarcate a Sub-List.
For instance, an HTML divider-element like<DIV class=someClass ...> ... </DIV>
as an 'inclusive return-value' that will likely have manyHTMLNode's
in that returned list.- Parameters:
html
- This may be any vectorized-html page, or sub-page.name
- This should be a valid HTML'NAME'
Attribute- Value (inner-tag value). This a "pre-HTML-5" used tag, that has been largely deprecated, and subsequently replaced by the'ID'
and'CLASS'
CSS-Attributes.- Returns:
- A "list of lists" for each opening and closing HTML Element match. Instances
of
'SubSection'
contain both the html sub-page as aVector
, and the matching'DotPair' Vector
index-pointer from the originalVector
from whence they came. - See Also:
InnerTagPeekInclusive
- Code:
- Exact Method Body:
return InnerTagPeekInclusive.all(html, "name", TextComparitor.EQ_CI_TRM, name);
-
pollElementsByNameInclusive
public static java.util.Vector<java.util.Vector<HTMLNode>> pollElementsByNameInclusive (java.util.Vector<HTMLNode> html, java.lang.String name)
Java-Script's Elements by Name function retrieves all HTML Elements whoseNAME
-Attribute which matches a givenname
parameter.
Poll:
These operations simply behave like a combination of the'Get'
operation and the'Remove'
operation. In a'Poll'
styled method,HTMLNode's
are first removed, and afterwards, these removed nodes are put into a list and returned back to the invoking method.
Inclusive:
In this html search library, all the word 'inclusive' means, is that when an openingTagNode
is found by an 'inclusive method', before returning that node, the matching, and closing pair of thatTagNode
, along with allHTMLNode's
in-between, are included in the result.
This, effectively, means that'inclusive'
methods will always return either a complete Vectorized-HTML Sub-List, or aDotPair
instance instead. (DotPair's
are simply wrappers for a Starting-Index integer and an Ending-Index integer that mean to demarcate a Sub-List.
For instance, an HTML divider-element like<DIV class=someClass ...> ... </DIV>
as an 'inclusive return-value' that will likely have manyHTMLNode's
in that returned list.- Parameters:
html
- This may be any vectorized-html page, or sub-page.name
- This should be a valid HTML'NAME'
Attribute- Value (inner-tag value). This a "pre-HTML-5" used tag, that has been largely deprecated, and subsequently replaced by the'ID'
and'CLASS'
CSS-Attributes.- Returns:
- A "list of lists" for each opening and closing HTML Element match.
- See Also:
InnerTagPollInclusive
- Code:
- Exact Method Body:
return InnerTagPollInclusive.all(html, "name", TextComparitor.EQ_CI_TRM, name);
-
-