Class AbstractMapInletMapOutlet<KI,KO,VI,VO,I,O>

java.lang.Object
swim.streamlet.AbstractMapInletMapOutlet<KI,KO,VI,VO,I,O>
All Implemented Interfaces:
Inlet<I>, MapInlet<KI,VI,I>, MapInletMapOutlet<KI,KO,VI,VO,I,O>, MapOutlet<KO,VO,O>, Outlet<O>
Direct Known Subclasses:
FilterFieldsOperator

public abstract class AbstractMapInletMapOutlet<KI,KO,VI,VO,I,O> extends Object implements MapInletMapOutlet<KI,KO,VI,VO,I,O>
  • Field Details

  • Constructor Details

    • AbstractMapInletMapOutlet

      public AbstractMapInletMapOutlet()
  • Method Details

    • containsKey

      public abstract boolean containsKey(KO key)
      Description copied from interface: MapOutlet
      Returns true if the current state of this MapOutlet contains the given key; otherwise returns false.
      Specified by:
      containsKey in interface MapOutlet<KI,KO,VI>
    • get

      public abstract VO get(KO key)
      Description copied from interface: MapOutlet
      Returns the value assocaited with the given key in the current state of this MapOutlet, if defined; otherwise returns null.
      Specified by:
      get in interface MapOutlet<KI,KO,VI>
    • get

      public abstract O get()
      Description copied from interface: Outlet
      Returns the current state of this Outlet.
      Specified by:
      get in interface Outlet<KI>
    • keyIterator

      public abstract Iterator<KO> keyIterator()
      Description copied from interface: MapOutlet
      Returns an Iterator over the keys in the current state of this MapOutlet.
      Specified by:
      keyIterator in interface MapOutlet<KI,KO,VI>
    • input

      public MapOutlet<KI,VI,? extends I> input()
      Description copied from interface: Inlet
      Returns the Outlet from which this Inlet acquires its state; returns null if this Inlet is disconnected.
      Specified by:
      input in interface Inlet<KI>
    • bindInput

      public void bindInput(Outlet<? extends I> input)
      Description copied from interface: Inlet
      Connects this Inlet to an Outlet from which it will acquire its state. If this Inlet is already connected, it will first disconnect from its existing input. Then, after updating its input property, the Inlet will invoke Outlet.bindOutput(Inlet) on its new input.
      Specified by:
      bindInput in interface Inlet<KI>
    • bindInput

      public void bindInput(MapOutlet<KI,VI,? extends I> input)
    • unbindInput

      public void unbindInput()
      Description copied from interface: Inlet
      Disconnects this Inlet from its input Outlet, if connected. After setting its input property to null, the Inlet will invoke Outlet.unbindOutput(Inlet) on its old input, if defined.
      Specified by:
      unbindInput in interface Inlet<KI>
    • disconnectInputs

      public void disconnectInputs()
      Description copied from interface: Inlet
      Disconnects all Inlets dominated by this Inlet in the dataflow dependency graph. Used to recursively clean up chains of combinators terminating at this Inlet.
      Specified by:
      disconnectInputs in interface Inlet<KI>
      Specified by:
      disconnectInputs in interface Outlet<KI>
    • outlet

      public Outlet<VO> outlet(KO key)
      Description copied from interface: MapOutlet
      Returns an Outlet that updates when the specified key updates.
      Specified by:
      outlet in interface MapOutlet<KI,KO,VI>
    • outputIterator

      public Iterator<Inlet<? super O>> outputIterator()
      Description copied from interface: Outlet
      Returns an Iterator over the set of Inlets that depend on the state of this Outlet.
      Specified by:
      outputIterator in interface Outlet<KI>
    • bindOutput

      public void bindOutput(Inlet<? super O> output)
      Description copied from interface: Outlet
      Adds an output to the set of Inlets that depend on the state of this Outlet. The output will be decohered when the state of this Outlet is decohered, and recohered when this Outlet is recohered.
      Specified by:
      bindOutput in interface Outlet<KI>
    • unbindOutput

      public void unbindOutput(Inlet<? super O> output)
      Description copied from interface: Outlet
      Removes an output from the set of Inlets that depend on the state of this Outlet.
      Specified by:
      unbindOutput in interface Outlet<KI>
    • unbindOutputs

      public void unbindOutputs()
      Description copied from interface: Outlet
      Disconnects all outputs from this Outlet by invoking Inlet.unbindInput() on each Inelt that depends on the state of this Outlet.
      Specified by:
      unbindOutputs in interface Outlet<KI>
    • disconnectOutputs

      public void disconnectOutputs()
      Description copied from interface: Inlet
      Disconnects all Outlets dominated by this Inlet in the dataflow graph. Used to recursively clean up chains of combinators passing through this Inlet.
      Specified by:
      disconnectOutputs in interface Inlet<KI>
      Specified by:
      disconnectOutputs in interface Outlet<KI>
    • decohereOutputKey

      public void decohereOutputKey(KI key, KeyEffect effect)
      Description copied from interface: MapInlet
      Marks this MapInlet as needing an effect applied to a given key. Decohering an individual key decoheres the entire state of the Inlet. But only the decoherent keys need to be updated in order to recohere the overall state of the Inlet.
      Specified by:
      decohereOutputKey in interface MapInlet<KI,KO,VI>
    • decohereInputKey

      public void decohereInputKey(KO key, KeyEffect effect)
      Description copied from interface: MapOutlet
      Marks this MapOutlet as needing an effect applied to a given key. Decohering an individual key decoheres the entire state of the Outlet. But only the decoherent keys need to be updated in order to recohere the overall state of the Outlet.
      Specified by:
      decohereInputKey in interface MapOutlet<KI,KO,VI>
    • decohereOutput

      public void decohereOutput()
      Description copied from interface: Inlet
      Marks this Inlet—and the Streamlet to which this Inlet is attached—as having decoherent state. Decohering an Inlet will recursively decohere all streamlets that transitively depend on the state of this Inlet. Decohering an Inlet does not cause its state to be recomputed. A subsequent Inlet.recohereOutput(int) call will eventually make the state of the Inlet coherent again.
      Specified by:
      decohereOutput in interface Inlet<KI>
    • decohereInput

      public void decohereInput()
      Description copied from interface: Outlet
      Marks this Outlet—and all outputs that depend on the state of this Outlet—as having decoherent state.
      Specified by:
      decohereInput in interface Outlet<KI>
    • decohere

      public void decohere()
    • recohereOutputKey

      public void recohereOutputKey(KI key, int version)
      Description copied from interface: MapInlet
      Updates the state of an individual key in this MapInlet to make it consistent with the target version. The MapInlet only needs to update if the current version differs from the target version. To update the state of a key, the MapInlet first invokes MapOutlet.recohereInputKey(Object, int) on its input, if its input is a MapOutlet, or it invokes Outlet.recohereInput(int), if its input is not a MapOutlet. Then, if all decoherent keys have been recohered, the MapInlet invokes Streamlet.recohere(int) on its attached streamlet.
      Specified by:
      recohereOutputKey in interface MapInlet<KI,KO,VI>
    • recohereInputKey

      public void recohereInputKey(KO key, int version)
      Description copied from interface: MapOutlet
      Updates the state of an individual key in this MapOutlet to make it consistent with the target version. The MapOutlet only needs to update if its current version differs from the target version. To update the state of a key, the MapOutlet first invokes Streamlet.recohere(int) on its attached streamlets. Then, for each dependent output, it invokes MapInlet.recohereOutputKey(Object, int), if the dependent output is a MapInlet, or it invokes Inlet.recohereOutput(int), if the dependent output is not a MapInlet.
      Specified by:
      recohereInputKey in interface MapOutlet<KI,KO,VI>
    • recohereOutput

      public void recohereOutput(int version)
      Description copied from interface: Inlet
      Updates the state of this Inlet to make it consistent with the target version. The Inlet only needs to update if its current version differs from the target version. To update its state, the Inlet first invokes Outlet.recohereInput(int) on its input, to ensure that its input is coherent. It then invokes Streamlet.recohere(int) on the Streamlet to which it's attached, causing the Streamlet to make its own state coherent again.
      Specified by:
      recohereOutput in interface Inlet<KI>
    • recohereInput

      public void recohereInput(int version)
      Description copied from interface: Outlet
      Updates the state of this Outlet to make it consistent with the target version. The Outlet only needs to update if its current version differs from the target version. To update its state, the Outlet first invokes Streamlet.recohere(int) on the Streamlet to which it's attached. It then invokes Inlet.recohereOutput(int) on each of its dependent outputs.
      Specified by:
      recohereInput in interface Outlet<KI>
    • recohere

      public void recohere(int version)
    • willDecohereOutputKey

      protected void willDecohereOutputKey(KI key, KeyEffect effect)
    • onDecohereOutputKey

      protected void onDecohereOutputKey(KI key, KeyEffect effect)
    • didDecohereOutputKey

      protected void didDecohereOutputKey(KI key, KeyEffect effect)
    • willDecohereInputKey

      protected void willDecohereInputKey(KO key, KeyEffect effect)
    • onDecohereInputKey

      protected void onDecohereInputKey(KO key, KeyEffect effect)
    • didDecohereInputKey

      protected void didDecohereInputKey(KO key, KeyEffect effect)
    • willDecohere

      protected void willDecohere()
    • onDecohere

      protected void onDecohere()
    • didDecohere

      protected void didDecohere()
    • willRecohereOutputKey

      protected void willRecohereOutputKey(KI key, KeyEffect effect, int version)
    • onRecohereOutputKey

      protected void onRecohereOutputKey(KI key, KeyEffect effect, int version)
    • didRecohereOutputKey

      protected void didRecohereOutputKey(KI key, KeyEffect effect, int version)
    • willRecohereInputKey

      protected KeyEffect willRecohereInputKey(KO key, KeyEffect effect, int version)
    • onRecohereInputKey

      protected void onRecohereInputKey(KO key, KeyEffect effect, int version)
    • didRecohereInputKey

      protected void didRecohereInputKey(KO key, KeyEffect effect, int version)
    • willRecohere

      protected void willRecohere(int version)
    • onRecohere

      protected void onRecohere(int version)
    • didRecohere

      protected void didRecohere(int version)