public class StreamMonitor
extends java.lang.Object
implements java.lang.Runnable
Constructor and Description |
---|
StreamMonitor(java.io.InputStream istr)
Equivalent to StreamMonitor(istr, null, false)
|
StreamMonitor(java.io.InputStream istr,
java.lang.String prefixString,
boolean printContents) |
Modifier and Type | Method and Description |
---|---|
boolean |
addTrigger(java.lang.String[] strs,
int value)
Adds a "trigger", which the stream watches for and, if seen,
reports the trigger value of via the getTriggers() method.
|
boolean |
addTrigger(java.lang.String str,
int value)
Adds a "trigger", which the stream watches for and, if seen,
reports the trigger value of via the getTriggers() method.
|
java.util.List |
getTriggersSeen()
Returns an List of java.lang.Integer objects indicating the
values of the triggers seen since the last call to
getTriggersSeen.
|
boolean |
removeTrigger(java.lang.String str)
Removes a previously added trigger.
|
boolean |
removeTrigger(java.lang.String[] strs)
Removes a previously added trigger.
|
void |
run() |
void |
startCapture() |
java.lang.String |
stopCapture() |
boolean |
waitFor(java.lang.String str,
long millis)
Waits for the specified string to come in for the given period
of time (measured in milliseconds).
|
public StreamMonitor(java.io.InputStream istr)
public StreamMonitor(java.io.InputStream istr, java.lang.String prefixString, boolean printContents)
public boolean addTrigger(java.lang.String str, int value)
public boolean addTrigger(java.lang.String[] strs, int value)
public boolean removeTrigger(java.lang.String str)
public boolean removeTrigger(java.lang.String[] strs)
public java.util.List getTriggersSeen()
public boolean waitFor(java.lang.String str, long millis)
public void startCapture()
public java.lang.String stopCapture()
public void run()
run
in interface java.lang.Runnable
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.