org.graphstream.stream.net
Interface URLSource

All Superinterfaces:
Source

public interface URLSource
extends Source

Graph event input source from an URL.


Method Summary
 void begin(URL url)
          Begin fetching the URL stopping as soon as possible.
 void end()
          Finish the reading process (even if nextEvents() did not returned false).
 void fetchAll(URL url)
          Read the whole URL in one big non-interruptible operation.
 boolean nextEvents()
          Try to process one graph event, or as few as possible, if more must be read at once.
 
Methods inherited from interface org.graphstream.stream.Source
addAttributeSink, addElementSink, addSink, clearAttributeSinks, clearElementSinks, clearSinks, removeAttributeSink, removeElementSink, removeSink
 

Method Detail

fetchAll

void fetchAll(URL url)
              throws IOException
Read the whole URL in one big non-interruptible operation.

Parameters:
url - The URL to fetch.
Throws:
IOException - If an I/O error occurs while fetching the URL.

begin

void begin(URL url)
           throws IOException
Begin fetching the URL stopping as soon as possible. Next graph events from the URL will be send by calling nextEvents(). Once begin() as been called, you must finish the reading process using end(). You cannot call begin() twice without having called end() in between.

Parameters:
url - The URL to fetch.
Throws:
IOException - If an I/O error occurs while reading.

nextEvents

boolean nextEvents()
                   throws IOException
Try to process one graph event, or as few as possible, if more must be read at once. For this method to work, you must have called begin(URL). This method return true while there are still events to read.

Returns:
true if there are still events to read, false as soon as the file is finished.
Throws:
IOException - If an I/O error occurs while reading.

end

void end()
         throws IOException
Finish the reading process (even if nextEvents() did not returned false). You must call this method after reading.

Throws:
IOException - If an I/O error occurs while closing the file.


Copyright © 2011. All Rights Reserved.