Class 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.Object
    Represents a gate that facilitates communication between nodes in a stream.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      class  FGate.InsideGate
      Represents the internal side of the gate.
      class  FGate.OutSideGate
      Represents the external side of the gate.
      static class  FGate.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> acceptor
      AcceptorI instance that defines how to accept and process data.
      FGate.InsideGate inSide
      InsideGate instance representing the internal side of the gate.
      Gate<ToOut,​ToNode> link
      Volatile Gate reference to ensure visibility and atomicity across threads.
    • Constructor Summary

      Constructors 
      Constructor Description
      FGate​(AcceptorI<ToOut,​ToNode> acceptor)
      Constructs a new FGate with the specified acceptor.
    • 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.String toString()
      Returns a string representation of the gate's internal side.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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.
      • link

        public volatile Gate<ToOut,​ToNode> link
        Volatile Gate reference to ensure visibility and atomicity across threads.
    • Constructor Detail

      • FGate

        public FGate​(AcceptorI<ToOut,​ToNode> acceptor)
        Constructs a new FGate with the specified acceptor.
        Parameters:
        acceptor - The AcceptorI instance that defines how to accept and process data.
    • Method Detail

      • toString

        public java.lang.String toString()
        Returns a string representation of the gate's internal side.
        Overrides:
        toString in class java.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.