Package io.aether.utils.streams
Class BufferNode.BGate<TIn,TOut>
- java.lang.Object
-
- io.aether.utils.streams.FGate.Pair<TIn,TOut,TIn>
-
- io.aether.utils.streams.BufferNode.BGate<TIn,TOut>
-
- Type Parameters:
TIn- the type of incoming dataTOut- the type of outgoing data
- All Implemented Interfaces:
io.aether.utils.interfaces.ObjectFind,AcceptorI<TOut,TIn>,io.aether.utils.ToString
- Direct Known Subclasses:
BufferNode.BGateDown,BufferNode.BGateUp
- Enclosing class:
- BufferNode<TRead,TWrite>
public abstract class BufferNode.BGate<TIn,TOut> extends FGate.Pair<TIn,TOut,TIn>
Represents a buffer gate that can send and receive data.
-
-
Constructor Summary
Constructors Constructor Description BGate(java.lang.Object owner)Constructs a newBufferNode.BGatewith the specified owner.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intcountDataValues()<T1> T1find(io.aether.utils.CTypeI<T1> type)Finds an object of the specified type.<T1> T1find(java.lang.Class<T1> type)Finds an object of the specified class.java.util.Queue<Value<TIn>>getQueue()Returns the queue of values.booleanisPause()Checks if writing is paused.booleanisProcessing()voidpause()Pauses writing to the buffer.voidrequestDataPair(long id)voidrequestDataPair(Value<TIn> r)Requests a pair of data.abstract voidresume()Resumes sending data.voidresume(FGate<TIn,TOut> g)Resumes sending data through the specified gate.voidsend(FGate<TIn,TOut> fGate, Value<TIn> value)Sends data through the gate and adds it to the queue.voidsetFGate(FGate<TIn,TOut> g)-
Methods inherited from class io.aether.utils.streams.FGate.Pair
pair, toString, toString
-
-
-
-
Constructor Detail
-
BGate
public BGate(java.lang.Object owner)
Constructs a newBufferNode.BGatewith the specified owner.- Parameters:
owner- the owner of this gate
-
-
Method Detail
-
countDataValues
public int countDataValues()
-
isProcessing
public boolean isProcessing()
-
find
public <T1> T1 find(io.aether.utils.CTypeI<T1> type)
Finds an object of the specified type.- Specified by:
findin interfaceio.aether.utils.interfaces.ObjectFind- Overrides:
findin classFGate.Pair<TIn,TOut,TIn>- Type Parameters:
T1- the type parameter- Parameters:
type- the type to find- Returns:
- the found object or null if not found
-
find
public <T1> T1 find(java.lang.Class<T1> type)
Finds an object of the specified class.- Specified by:
findin interfaceio.aether.utils.interfaces.ObjectFind- Overrides:
findin classFGate.Pair<TIn,TOut,TIn>- Type Parameters:
T1- the type parameter- Parameters:
type- the class to find- Returns:
- the found object or null if not found
-
pause
public void pause()
Pauses writing to the buffer.
-
isPause
public final boolean isPause()
Checks if writing is paused.- Returns:
- true if writing is paused, false otherwise
-
send
public void send(FGate<TIn,TOut> fGate, Value<TIn> value)
Sends data through the gate and adds it to the queue.- Parameters:
fGate- the gate to send data throughvalue- the data to send
-
requestDataPair
public void requestDataPair(long id)
-
resume
public abstract void resume()
Resumes sending data.
-
resume
public void resume(FGate<TIn,TOut> g)
Resumes sending data through the specified gate.- Parameters:
g- the gate to send data through
-
-