infovis.graph.io
Class HTMLGraphReader

java.lang.Object
  extended by infovis.io.AbstractReader
      extended by infovis.table.io.AbstractTableReader
          extended by infovis.graph.io.HTMLGraphReader

public class HTMLGraphReader
extends AbstractTableReader

The HTMLGraphReader is creates a graph from html web sites.

Version:
$Revision: 1.26 $
Author:
Jean-Daniel Fekete
InfoVis factory arguments:
GraphReaderFactory html

Field Summary
static String COLUMN_DATE
           
static String COLUMN_LENGTH
           
static String COLUMN_MIME_TYPE
           
static String COLUMN_NAME
           
static String COLUMN_REF
           
static String COLUMN_TITLE
           
static String COLUMN_URL
           
 
Constructor Summary
HTMLGraphReader(String name, Graph graph)
          Constructor for HTMLGraphReader.
 
Method Summary
 boolean add(String url)
          Adds a specified url to the queue of URL to load.
 boolean add(URL url)
          Adds a specified url to the queue of URL to load.
 void annotateWithLog(BufferedReader in, String path)
          DOCUMENT ME!
 boolean considerURL(URL url)
          Test whether a specified URL should be considered for loading.
 ObjectColumn createUrlColumn(ObjectColumn obj)
          Creates a column of URLs.
 URL getBase()
           
 PrintStream getLog()
          Returns the log.
 LinkedList getQueue()
          Returns the list of URL strings on the queue
 URL getRealRoot()
          Returns the realRoot.
 Map getUrlMap()
          Returns the URL map.
 boolean isAddingURL()
           
 boolean load()
          Main method for loading the file.
 int loadOne(String urlString)
           
 URL normalize(URL url)
          Normalize a specified URL.
 boolean remove(String urlString)
           
 void setAddingURL(boolean b)
           
 void setLog(PrintStream log)
          Sets the log.
 void setQueue(LinkedList list)
          Sets the list of URLs to load, as strings
 void setRealRoot(URL realRoot)
          Sets the realRoot.
 
Methods inherited from class infovis.table.io.AbstractTableReader
close, getBuffer, getBufferedReader, getCommentChar, getField, getIn, getTable, ignoreLine, isEof, read, readInt, readLine, readQuoted, setBuffer, setCommentChar, setEof, setTable, skipToEol
 
Methods inherited from class infovis.io.AbstractReader
createColumn, getEncoding, getName, guessFieldType, setEncoding, setIn, setName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COLUMN_NAME

public static final String COLUMN_NAME
See Also:
Constant Field Values

COLUMN_URL

public static final String COLUMN_URL
See Also:
Constant Field Values

COLUMN_LENGTH

public static final String COLUMN_LENGTH
See Also:
Constant Field Values

COLUMN_DATE

public static final String COLUMN_DATE
See Also:
Constant Field Values

COLUMN_MIME_TYPE

public static final String COLUMN_MIME_TYPE
See Also:
Constant Field Values

COLUMN_TITLE

public static final String COLUMN_TITLE
See Also:
Constant Field Values

COLUMN_REF

public static final String COLUMN_REF
See Also:
Constant Field Values
Constructor Detail

HTMLGraphReader

public HTMLGraphReader(String name,
                       Graph graph)
Constructor for HTMLGraphReader.

Parameters:
name - the URL to load.
graph - the Graph to read.
Method Detail

considerURL

public boolean considerURL(URL url)
Test whether a specified URL should be considered for loading.

Parameters:
url - the url.
Returns:
true if a specified URL should be considered for loading.

add

public boolean add(String url)
Adds a specified url to the queue of URL to load.

Parameters:
url - the url.
Returns:
true if the URL has been queued.

normalize

public URL normalize(URL url)
Normalize a specified URL.

Parameters:
url - the URL.
Returns:
the normalized URL.

add

public boolean add(URL url)
Adds a specified url to the queue of URL to load.

Parameters:
url - the url.
Returns:
true if the URL has been queued.

remove

public boolean remove(String urlString)

loadOne

public int loadOne(String urlString)
            throws FileNotFoundException,
                   IOException
Throws:
FileNotFoundException
IOException

load

public boolean load()
Description copied from class: AbstractReader
Main method for loading the file. The loading may fail at any point, leaving the table in an indefinite state if the methods returns false.

Specified by:
load in class AbstractReader
Returns:
true if the file has been loaded without error, false otherwise.
See Also:
AbstractReader.load()

createUrlColumn

public ObjectColumn createUrlColumn(ObjectColumn obj)
Creates a column of URLs.

Parameters:
obj - an ObjectColumn which will contain the urls. If null, a new one will be created with "URL" as name.

getUrlMap

public Map getUrlMap()
Returns the URL map.

Returns:
the URL map.

getLog

public PrintStream getLog()
Returns the log.

Returns:
PrintStream

setLog

public void setLog(PrintStream log)
Sets the log.

Parameters:
log - The log to set

annotateWithLog

public void annotateWithLog(BufferedReader in,
                            String path)
DOCUMENT ME!

Parameters:
in - DOCUMENT ME!
path - DOCUMENT ME!

getRealRoot

public URL getRealRoot()
Returns the realRoot.

Returns:
URL

setRealRoot

public void setRealRoot(URL realRoot)
Sets the realRoot.

Parameters:
realRoot - The realRoot to set

getQueue

public LinkedList getQueue()
Returns the list of URL strings on the queue

Returns:
the list of URL strings on the queue

setQueue

public void setQueue(LinkedList list)
Sets the list of URLs to load, as strings

Parameters:
list - the list of URLs to load, as strings

isAddingURL

public boolean isAddingURL()

setAddingURL

public void setAddingURL(boolean b)

getBase

public URL getBase()


Copyright © 2005 by Jean-Daniel Fekete and INRIA, France All rights reserved.