KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > core > model > IStreamMonitor


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.debug.core.model;
12
13
14 import org.eclipse.debug.core.IStreamListener;
15
16 /**
17  * A stream monitor manages the contents of the stream a process
18  * is writing to, and notifies registered listeners of changes in
19  * the stream.
20  * <p>
21  * Clients may implement this interface. Generally, a client that
22  * provides an implementation of the <code>IStreamsProxy</code>
23  * interface must also provide an implementation of this interface.
24  * </p>
25  * @see org.eclipse.debug.core.model.IStreamsProxy
26  * @see org.eclipse.debug.core.model.IFlushableStreamMonitor
27  */

28 public interface IStreamMonitor {
29     /**
30      * Adds the given listener to this stream monitor's registered listeners.
31      * Has no effect if an identical listener is already registered.
32      *
33      * @param listener the listener to add
34      */

35     public void addListener(IStreamListener listener);
36     /**
37      * Returns the entire current contents of the stream. An empty
38      * String is returned if the stream is empty.
39      *
40      * @return the stream contents as a <code>String</code>
41      */

42     public String JavaDoc getContents();
43     /**
44      * Removes the given listener from this stream monitor's registered listeners.
45      * Has no effect if the listener is not already registered.
46      *
47      * @param listener the listener to remove
48      */

49     public void removeListener(IStreamListener listener);
50 }
51
Popular Tags