public class URLGenerator extends BaseGenerator
Modifier and Type | Class and Description |
---|---|
static class |
URLGenerator.Mode |
static interface |
URLGenerator.URLFilter
Defines url filter.
|
Constructor and Description |
---|
URLGenerator(java.lang.String... startFrom) |
Modifier and Type | Method and Description |
---|---|
void |
acceptOnlyMatchingURL(java.lang.String regex)
Can be used to filter url.
|
void |
addHostFilter(java.lang.String... hosts)
Can be used to filter url according to the host.
|
void |
addURL(java.lang.String url)
Add an url to process.
|
void |
begin()
Begin the graph generation.
|
void |
declineMatchingURL(java.lang.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(java.lang.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(java.lang.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.
|
addEdgeAttribute, addEdgeAttribute, addEdgeAttribute, addEdgeLabels, addNodeAttribute, addNodeAttribute, addNodeAttribute, addNodeLabels, end, isUsingInternalGraph, removeEdgeAttribute, removeNodeAttribute, setDirectedEdges, setRandomSeed, setUseInternalGraph
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
public void begin()
Generator
Generator.nextEvents()
method to add elements to the graph.public boolean nextEvents()
Generator
public void addURL(java.lang.String url)
url
- a new urlpublic void setDirected(boolean on)
on
- true to create directed edgespublic void setNodeWeightAttribute(java.lang.String attribute)
attribute
- attribute key of the weight of nodespublic void setEdgeWeightAttribute(java.lang.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
- maximum steps before stoppublic void enableProgression(boolean on)
public void acceptOnlyMatchingURL(java.lang.String regex)
regex
- regex used to filter urlpublic void declineMatchingURL(java.lang.String regex)
regex
- regex used to filter urlpublic void addHostFilter(java.lang.String... hosts)
hosts
- list of accepted hosts