Class UrlTreeNode

java.lang.Object
  extended byUrlTreeNode

public class UrlTreeNode
extends java.lang.Object

Class used to hold information about a web site that has been searched by the spider class

Author:
Mark Pendergast

Constructor Summary
UrlTreeNode(java.lang.String atext)
          Creates a new instance of UrlTreeNode
UrlTreeNode(java.net.URL aurl)
          Creates a new instance of UrlTreeNode
 
Method Summary
 void addChars(int n)
          Increments character count
 void addImages(int n)
          Increments image count
 void addLinks(int n)
          Increments link count
 boolean equals(java.lang.String urlstr)
          test for equality
 java.net.URL getBase()
          returns base url
 java.lang.String getKeywords()
          get the keywords found in this node
 java.lang.String getNodeStats()
          retrieves character, link, and image count as a displayable string
 java.net.URL getUrl()
          returns the url object for this node or null if it is a text node
 java.lang.String getUrlString()
          retrieves the url as a string
 boolean isMatch()
          return state of node
 void setBase(java.lang.String abase)
          sets the base location for the node, called in response to finding a base tag in the web page
 void setMatch(java.lang.String keyword)
          returns whether or not this node contains a match for the spiders search criteria
 void setTitle(java.lang.String atitle)
          sets the title attribute of the node
 java.lang.String toString()
          return url string for display on screen
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UrlTreeNode

public UrlTreeNode(java.net.URL aurl)
Creates a new instance of UrlTreeNode

Parameters:
aurl - url of the web page

UrlTreeNode

public UrlTreeNode(java.lang.String atext)
Creates a new instance of UrlTreeNode

Parameters:
atext - text for the node
Method Detail

toString

public java.lang.String toString()
return url string for display on screen

Returns:
String representation of the object

getKeywords

public java.lang.String getKeywords()
get the keywords found in this node

Returns:
all keywords in this node as a single comma separated string

isMatch

public boolean isMatch()
return state of node

Returns:
true if node matched search criteria

getUrl

public java.net.URL getUrl()
returns the url object for this node or null if it is a text node

Returns:
url of the node or null

setMatch

public void setMatch(java.lang.String keyword)
returns whether or not this node contains a match for the spiders search criteria

Parameters:
keyword - keyword found in web site.

setBase

public void setBase(java.lang.String abase)
sets the base location for the node, called in response to finding a base tag in the web page

Parameters:
abase - base url to use for relative addressing

getBase

public java.net.URL getBase()
returns base url

Returns:
base url

setTitle

public void setTitle(java.lang.String atitle)
sets the title attribute of the node

Parameters:
atitle - title of web page from tag</DL> </DD> </DL> <HR> <A NAME="equals(java.lang.String)"><!-- --></A><H3> equals</H3> <PRE> public boolean <B>equals</B>(java.lang.String urlstr)</PRE> <DL> <DD>test for equality <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>urlstr</CODE> - string containing url to compare <DT><B>Returns:</B><DD>true if it is the same page</DL> </DD> </DL> <HR> <A NAME="addChars(int)"><!-- --></A><H3> addChars</H3> <PRE> public void <B>addChars</B>(int n)</PRE> <DL> <DD>Increments character count <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>n</CODE> - number of characters to add</DL> </DD> </DL> <HR> <A NAME="addLinks(int)"><!-- --></A><H3> addLinks</H3> <PRE> public void <B>addLinks</B>(int n)</PRE> <DL> <DD>Increments link count <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>n</CODE> - number of linkss to add</DL> </DD> </DL> <HR> <A NAME="addImages(int)"><!-- --></A><H3> addImages</H3> <PRE> public void <B>addImages</B>(int n)</PRE> <DL> <DD>Increments image count <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>n</CODE> - number of images to add</DL> </DD> </DL> <HR> <A NAME="getNodeStats()"><!-- --></A><H3> getNodeStats</H3> <PRE> public java.lang.String <B>getNodeStats</B>()</PRE> <DL> <DD>retrieves character, link, and image count as a displayable string <P> <DD><DL> <DT><B>Returns:</B><DD>pages statistics</DL> </DD> </DL> <HR> <A NAME="getUrlString()"><!-- --></A><H3> getUrlString</H3> <PRE> public java.lang.String <B>getUrlString</B>()</PRE> <DL> <DD>retrieves the url as a string <P> <DD><DL> <DT><B>Returns:</B><DD>url</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD>  </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev">  <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="UrlNodeRenderer.html" title="class in "><B>PREV CLASS</B></A>   <A HREF="VerifierListener.html" title="interface in "><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="index.html" target="_top"><B>FRAMES</B></A>    <A HREF="UrlTreeNode.html" target="_top"><B>NO FRAMES</B></A>    <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>