Class BufferNode.BGate<TIn,​TOut>

  • Type Parameters:
    TIn - the type of incoming data
    TOut - 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.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Queue<Value<TIn>> queue  
    • Constructor Summary

      Constructors 
      Constructor Description
      BGate​(java.lang.Object owner)
      Constructs a new BufferNode.BGate with the specified owner.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      int countDataValues()  
      <T1> T1 find​(io.aether.utils.CTypeI<T1> type)
      Finds an object of the specified type.
      <T1> T1 find​(java.lang.Class<T1> type)
      Finds an object of the specified class.
      java.util.Queue<Value<TIn>> getQueue()
      Returns the queue of values.
      boolean isPause()
      Checks if writing is paused.
      boolean isProcessing()  
      void pause()
      Pauses writing to the buffer.
      void requestDataPair​(long id)  
      void requestDataPair​(Value<TIn> r)
      Requests a pair of data.
      abstract void resume()
      Resumes sending data.
      void resume​(FGate<TIn,​TOut> g)
      Resumes sending data through the specified gate.
      void send​(FGate<TIn,​TOut> fGate, Value<TIn> value)
      Sends data through the gate and adds it to the queue.
      void setFGate​(FGate<TIn,​TOut> g)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface io.aether.utils.interfaces.ObjectFind

        getOwners
      • Methods inherited from interface io.aether.utils.ToString

        toString2
    • Field Detail

      • queue

        protected final java.util.Queue<Value<TIn>> queue
    • Constructor Detail

      • BGate

        public BGate​(java.lang.Object owner)
        Constructs a new BufferNode.BGate with 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:
        find in interface io.aether.utils.interfaces.ObjectFind
        Overrides:
        find in class FGate.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:
        find in interface io.aether.utils.interfaces.ObjectFind
        Overrides:
        find in class FGate.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 through
        value - the data to send
      • requestDataPair

        public void requestDataPair​(Value<TIn> r)
        Requests a pair of data.
      • 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
      • getQueue

        public java.util.Queue<Value<TIn>> getQueue()
        Returns the queue of values.
        Returns:
        the queue of values