Package mgui.interfaces.io
Class DataBridge<T extends MguiNumber>
java.lang.Object
mgui.interfaces.io.DataBridge<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
DataInputStream<T>
,DataOutputStream<T>
,DataSourceListener
- Direct Known Subclasses:
DataBridgeXY
public abstract class DataBridge<T extends MguiNumber> extends java.lang.Object implements DataInputStream<T>, DataOutputStream<T>
Represents a data bridge, combining an input stream and an output stream.
TODO: Make this object and all I/O objects thread safe.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Field Summary
Fields Modifier and Type Field Description boolean
closed
java.util.ArrayList<DataInputStreamListener<T>>
inputListeners
-
Constructor Summary
Constructors Constructor Description DataBridge()
-
Method Summary
Modifier and Type Method Description void
addInputStreamListener(DataInputStreamListener<T> l)
void
close()
Closes this stream.void
dataSourceEmission(DataSourceEvent event)
Responds to a signal emission from a data source.protected void
fireListeners()
void
removeInputStreamListener(DataInputStreamListener<T> l)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface mgui.interfaces.io.DataInputStream
getData, getDataAsBytes
Methods inherited from interface mgui.interfaces.io.DataOutputStream
setData, setDataAsBytes
Methods inherited from interface mgui.interfaces.io.DataSourceListener
dataSourceReset
-
Field Details
-
closed
public boolean closed -
inputListeners
-
-
Constructor Details
-
DataBridge
public DataBridge()
-
-
Method Details
-
addInputStreamListener
- Specified by:
addInputStreamListener
in interfaceDataInputStream<T extends MguiNumber>
-
removeInputStreamListener
- Specified by:
removeInputStreamListener
in interfaceDataInputStream<T extends MguiNumber>
-
dataSourceEmission
Description copied from interface:DataSourceListener
Responds to a signal emission from a data source.- Specified by:
dataSourceEmission
in interfaceDataSourceListener
-
fireListeners
protected void fireListeners() -
close
public void close()Description copied from interface:DataInputStream
Closes this stream.- Specified by:
close
in interfaceDataInputStream<T extends MguiNumber>
- Specified by:
close
in interfaceDataOutputStream<T extends MguiNumber>
-