com.openharbor.beck.map
Interface PollableInput

All Known Implementing Classes:
PollableResource, PollableURL

public interface PollableInput

A byte vector with a relatively efficient method to check whether it has changed. Implementations are not required to be thread-safe.


Field Summary
static long SECONDS
          For example, setAcceptableStaleness(60 * SECONDS).
 
Method Summary
 java.lang.String getSystemID()
          The SystemID that identifies the input source, or null if its SystemID is unknown.
 java.io.InputStream input()
          Begin reading the data (as a stream of bytes).
 java.io.InputStream inputIfModified()
          Begin reading the data (as a stream of bytes) if it has changed since the last call to input() or inputIfModified().
 void pollSoon()
          Check for a change in the data next time inputIfModified is called, regardless of the currently acceptable staleness.
 void setAcceptableStaleness(long msec)
          Set the maximum amount of time that may elapse from a change in the data until the change is detected by this object.
 

Field Detail

SECONDS

public static final long SECONDS
For example, setAcceptableStaleness(60 * SECONDS).

See Also:
Constant Field Values
Method Detail

getSystemID

public java.lang.String getSystemID()
The SystemID that identifies the input source, or null if its SystemID is unknown.


input

public java.io.InputStream input()
                          throws java.io.IOException
Begin reading the data (as a stream of bytes).

Throws:
java.io.IOException

inputIfModified

public java.io.InputStream inputIfModified()
                                    throws java.io.IOException
Begin reading the data (as a stream of bytes) if it has changed since the last call to input() or inputIfModified().

Returns:
a stream that will produce the data, or null to indicate that the data have not changed.
Throws:
java.io.IOException

pollSoon

public void pollSoon()
Check for a change in the data next time inputIfModified is called, regardless of the currently acceptable staleness.


setAcceptableStaleness

public void setAcceptableStaleness(long msec)
Set the maximum amount of time that may elapse from a change in the data until the change is detected by this object.

Parameters:
msec - the acceptable staleness, in units of milliseconds.