Package io.aether.utils.streams
Class FGate<ToNode,ToOut>
- java.lang.Object
-
- io.aether.utils.streams.FGate<ToNode,ToOut>
-
- Type Parameters:
ToNode- The type of data processed by the node on one side of the gate.ToOut- The type of data output from the node through the gate.
- Direct Known Subclasses:
HttpStream
public class FGate<ToNode,ToOut> extends java.lang.ObjectRepresents a gate that facilitates communication between nodes in a stream.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classFGate.InsideGateRepresents the internal side of the gate.classFGate.OutSideGateRepresents the external side of the gate.static classFGate.Pair<TIn,TOut,PairOut>Abstract class representing a pair of gates with an owner.
-
Field Summary
Fields Modifier and Type Field Description AcceptorI<ToOut,ToNode>acceptorAcceptorI instance that defines how to accept and process data.FGate.InsideGateinSideInsideGate instance representing the internal side of the gate.Gate<ToOut,ToNode>linkVolatile Gate reference to ensure visibility and atomicity across threads.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <TIn,TOut>
FGate<TIn,TOut>of(AcceptorI<TOut,TIn> acceptor)Creates a new FGate with the specified acceptor.static <TIn,TOut>
FGate<TIn,TOut>of(Gate<TOut,TIn> link, AcceptorI<TOut,TIn> acceptor)Creates a new FGate with the specified link and acceptor.Gate<ToNode,ToOut>outSide()Returns the external side of the gate as a Gate instance.java.lang.StringtoString()Returns a string representation of the gate's internal side.
-
-
-
Field Detail
-
acceptor
public final AcceptorI<ToOut,ToNode> acceptor
AcceptorI instance that defines how to accept and process data.
-
inSide
public final FGate.InsideGate inSide
InsideGate instance representing the internal side of the gate.
-
-
Method Detail
-
toString
public java.lang.String toString()
Returns a string representation of the gate's internal side.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the gate's internal side.
-
outSide
public Gate<ToNode,ToOut> outSide()
Returns the external side of the gate as a Gate instance.- Returns:
- The external side of the gate as a Gate instance.
-
of
public static <TIn,TOut> FGate<TIn,TOut> of(AcceptorI<TOut,TIn> acceptor)
Creates a new FGate with the specified acceptor.- Type Parameters:
TIn- The type of data processed by the node on one side of the gate.TOut- The type of data output from the node through the gate.- Parameters:
acceptor- The AcceptorI instance that defines how to accept and process data.- Returns:
- A new FGate with the specified acceptor.
-
of
public static <TIn,TOut> FGate<TIn,TOut> of(Gate<TOut,TIn> link, AcceptorI<TOut,TIn> acceptor)
Creates a new FGate with the specified link and acceptor.- Type Parameters:
TIn- The type of data processed by the node on one side of the gate.TOut- The type of data output from the node through the gate.- Parameters:
link- The Gate instance to which this FGate will be linked.acceptor- The AcceptorI instance that defines how to accept and process data.- Returns:
- A new FGate with the specified link and acceptor.
-
-