|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.tree.DefaultTreeModel
com.antelmann.net.URLTree
public class URLTree
URLTree represents the model of a tree where each node is made of
a URL wrapped in a URLNode object. The tree is configurable in size
by adding restrictions that determine whether a URLNode is included
in the tree or not.
Note that changing parameters of the CrawlerSetting used by the URL tree
without recalculating the tree may put the tree in an inconsistent
state.
URLNode,
Serialized Form| Field Summary |
|---|
| Fields inherited from class javax.swing.tree.DefaultTreeModel |
|---|
asksAllowsChildren, listenerList, root |
| Constructor Summary | |
|---|---|
URLTree(URL root)
calls URLTree(root, new SampleCrawlerSetting(), false) |
|
URLTree(URL root,
CrawlerSetting crawler,
boolean singlePath)
|
|
| Method Summary | |
|---|---|
CrawlerSetting |
getCrawler()
|
int |
getNumberOfNodes()
|
boolean |
getSinglePath()
if true, the URLTree allows every URL to only occur once in the tree |
void |
revalidate(boolean refresh)
recalculates the entire tree recursively from the root based on the current settings; this should be done every time when parameters of the crawler changed, otherwise the tree could be in an inconsisten state |
protected void |
revalidateNode(URLNode node,
boolean refresh)
internally called by recalculate(); recalculates sub-tree recursively |
void |
setCrawler(CrawlerSetting crawler)
on calling this method, the entire tree will be recalculated based on the settings of the new crawler |
void |
setRoot(TreeNode root)
overwritten to ensure proper immediate calculation of the entire new tree based on the new settings. |
void |
setRoot(URL root)
|
void |
setSinglePath(boolean singlePath)
if set to true, the URLTree allows every URL to only occur once in the tree; calling this function forces the entire tree to be revalidated from the root |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public URLTree(URL root)
URLTree(root, new SampleCrawlerSetting(), false)
public URLTree(URL root,
CrawlerSetting crawler,
boolean singlePath)
root - the root node of the treecrawler - restrictions that define the content of the URLTreesinglePath - if true, the tree allows each URL to occur only once in the tree| Method Detail |
|---|
public void setRoot(URL root)
public void setRoot(TreeNode root)
setRoot in class DefaultTreeModelClassCastException - if given node is not a URLNodepublic CrawlerSetting getCrawler()
public void setCrawler(CrawlerSetting crawler)
public boolean getSinglePath()
public void setSinglePath(boolean singlePath)
public void revalidate(boolean refresh)
refresh - if true, each cached node contend is refreshed,
i.e. reloaded from the net
protected void revalidateNode(URLNode node,
boolean refresh)
public int getNumberOfNodes()
public String toString()
toString in class Object
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||