Package org.graphstream.stream.net
Interface URLSource
- All Superinterfaces:
Source
public interface URLSource extends Source
Graph event input source from an URL.
-
Method Summary
Modifier and Type Method Description voidbegin(URL url)Begin fetching the URL stopping as soon as possible.voidend()Finish the reading process (even ifnextEvents()did not returned false).voidfetchAll(URL url)Read the whole URL in one big non-interruptible operation.booleannextEvents()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 Details
-
fetchAll
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
Begin fetching the URL stopping as soon as possible. Next graph events from the URL will be send by callingnextEvents(). Once begin() as been called, you must finish the reading process usingend(). You cannot call begin() twice without having calledend()in between.- Parameters:
url- The URL to fetch.- Throws:
IOException- If an I/O error occurs while reading.
-
nextEvents
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 calledbegin(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
Finish the reading process (even ifnextEvents()did not returned false). You must call this method after reading.- Throws:
IOException- If an I/O error occurs while closing the file.
-