|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.graphstream.stream.SourceBase
org.graphstream.algorithm.generator.BaseGenerator
org.graphstream.algorithm.generator.URLGenerator
public class URLGenerator
Generate a graph using the web. Some urls are given to start and the generator will extract links on these pages. Each url is a node and there is an edge between two urls when one has a link to the other. Links are extracted using the "href" attribute of html elements.
| Nested Class Summary | |
|---|---|
static class |
URLGenerator.Mode
|
static interface |
URLGenerator.URLFilter
Defines url filter. |
| Nested classes/interfaces inherited from class org.graphstream.stream.SourceBase |
|---|
org.graphstream.stream.SourceBase.ElementType |
| Constructor Summary | |
|---|---|
URLGenerator(String... startFrom)
|
|
| Method Summary | |
|---|---|
void |
acceptOnlyMatchingURL(String regex)
Can be used to filter url. |
void |
addHostFilter(String... hosts)
Can be used to filter url according to the host. |
void |
addURL(String url)
Add an url to process. |
void |
begin()
Begin the graph generation. |
void |
declineMatchingURL(String regex)
Can be used to filter url. |
void |
enableProgression(boolean on)
|
boolean |
nextEvents()
Perform the next step in generating the graph. |
void |
setDepthLimit(int depthLimit)
Set the maximum steps before stop. |
void |
setDirected(boolean on)
Create directed edges. |
void |
setEdgeWeightAttribute(String attribute)
Set the attribute key used to store weight of edges. |
void |
setMode(URLGenerator.Mode mode)
Set the way that url are converted to node id. |
void |
setNodeWeightAttribute(String attribute)
Set the attribute key used to store weight of nodes. |
void |
setThreadCount(int count)
Set the amount of threads used to parse urls. |
| Methods inherited from class org.graphstream.algorithm.generator.BaseGenerator |
|---|
addEdgeAttribute, addEdgeLabels, addNodeAttribute, addNodeLabels, end, isUsingInternalGraph, removeEdgeAttribute, removeNodeAttribute, setDirectedEdges, setEdgeAttributesRange, setNodeAttributesRange, setRandomSeed, setUseInternalGraph |
| Methods inherited from class org.graphstream.stream.SourceBase |
|---|
addAttributeSink, addElementSink, addSink, attributeSinks, clearAttributeSinks, clearElementSinks, clearSinks, elementSinks, removeAttributeSink, removeElementSink, removeSink, sendAttributeChangedEvent, sendAttributeChangedEvent, sendEdgeAdded, sendEdgeAdded, sendEdgeAttributeAdded, sendEdgeAttributeAdded, sendEdgeAttributeChanged, sendEdgeAttributeChanged, sendEdgeAttributeRemoved, sendEdgeAttributeRemoved, sendEdgeRemoved, sendEdgeRemoved, sendGraphAttributeAdded, sendGraphAttributeAdded, sendGraphAttributeChanged, sendGraphAttributeChanged, sendGraphAttributeRemoved, sendGraphAttributeRemoved, sendGraphCleared, sendGraphCleared, sendNodeAdded, sendNodeAdded, sendNodeAttributeAdded, sendNodeAttributeAdded, sendNodeAttributeChanged, sendNodeAttributeChanged, sendNodeAttributeRemoved, sendNodeAttributeRemoved, sendNodeRemoved, sendNodeRemoved, sendStepBegins, sendStepBegins |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.graphstream.stream.Source |
|---|
addAttributeSink, addElementSink, addSink, clearAttributeSinks, clearElementSinks, clearSinks, removeAttributeSink, removeElementSink, removeSink |
| Constructor Detail |
|---|
public URLGenerator(String... startFrom)
| Method Detail |
|---|
public void begin()
GeneratorGenerator.nextEvents() method to add elements to the graph.
public boolean nextEvents()
Generator
public void addURL(String url)
url - a new urlpublic void setDirected(boolean on)
on - true to create directed edgespublic void setNodeWeightAttribute(String attribute)
attribute - attribute key of the weight of nodespublic void setEdgeWeightAttribute(String attribute)
attribute - attribute key of the weight of edgespublic void setMode(URLGenerator.Mode mode)
mode - mode specifying how to convert url to have node idpublic void setThreadCount(int count)
nextEvents() step. At the end of this method, all working thread
have stop.
count - amount of threadspublic void setDepthLimit(int depthLimit)
depthLimit - public void enableProgression(boolean on)
public void acceptOnlyMatchingURL(String regex)
regex - public void declineMatchingURL(String regex)
regex - public void addHostFilter(String... hosts)
hosts - list of accepted hosts
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||