|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.tree.DefaultTreeModel
org.jscience.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(java.net.URL root)
calls URLTree(root, new SampleCrawlerSetting(), false) |
|
URLTree(java.net.URL root,
CrawlerSetting crawler,
boolean singlePath)
|
|
| Method Summary | |
|---|---|
CrawlerSetting |
getCrawler()
DOCUMENT ME! |
int |
getNumberOfNodes()
DOCUMENT ME! |
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(javax.swing.tree.TreeNode root)
overwritten to ensure proper immediate calculation of the entire new tree based on the new settings. |
void |
setRoot(java.net.URL root)
DOCUMENT ME! |
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 |
java.lang.String |
toString()
DOCUMENT ME! |
| Methods inherited from class javax.swing.tree.DefaultTreeModel |
|---|
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getPathToRoot, getRoot, getTreeModelListeners, insertNodeInto, isLeaf, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, reload, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, valueForPathChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public URLTree(java.net.URL root)
URLTree(root, new SampleCrawlerSetting(), false)
public URLTree(java.net.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(java.net.URL root)
root - DOCUMENT ME!public void setRoot(javax.swing.tree.TreeNode root)
setRoot in class javax.swing.tree.DefaultTreeModelroot - DOCUMENT ME!
java.lang.ClassCastException - if given node is not a URLNodepublic CrawlerSetting getCrawler()
public void setCrawler(CrawlerSetting crawler)
crawler - DOCUMENT ME!public boolean getSinglePath()
public void setSinglePath(boolean singlePath)
singlePath - DOCUMENT ME!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)
node - DOCUMENT ME!refresh - DOCUMENT ME!public int getNumberOfNodes()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||