Class AbstractMapInoutlet<K,VI,VO,I,O>

java.lang.Object
swim.streamlet.AbstractMapInoutlet<K,VI,VO,I,O>
All Implemented Interfaces:
Inlet<I>, Inoutlet<I,O>, MapInlet<K,VI,I>, MapInoutlet<K,VI,VO,I,O>, MapOutlet<K,VO,O>, Outlet<O>
Direct Known Subclasses:
MapFieldValuesOperator, MemoizeMapCombinator

public abstract class AbstractMapInoutlet<K,VI,VO,I,O> extends Object implements MapInoutlet<K,VI,VO,I,O>
  • Field Details

  • Constructor Details

    • AbstractMapInoutlet

      public AbstractMapInoutlet()
  • Method Details

    • containsKey

      public abstract boolean containsKey(K 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<K,VI,VO>
    • get

      public abstract VO get(K 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<K,VI,VO>
    • get

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

      public abstract Iterator<K> 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<K,VI,VO>
    • input

      public MapOutlet<K,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<K>
    • 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<K>
    • bindInput

      public void bindInput(MapOutlet<K,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<K>
    • disconnectInputs

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

      public Outlet<VO> outlet(K key)
      Description copied from interface: MapOutlet
      Returns an Outlet that updates when the specified key updates.
      Specified by:
      outlet in interface MapOutlet<K,VI,VO>
    • 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<K>
    • 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<K>
    • 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<K>
    • 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<K>
    • disconnectOutputs

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

      public void decohereOutputKey(K 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<K,VI,VO>
    • decohereInputKey

      public void decohereInputKey(K 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<K,VI,VO>
    • decohereKey

      public void decohereKey(K key, KeyEffect effect)
    • 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<K>
    • 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<K>
    • decohere

      public void decohere()
    • recohereOutputKey

      public void recohereOutputKey(K 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<K,VI,VO>
    • recohereInputKey

      public void recohereInputKey(K 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<K,VI,VO>
    • recohereKey

      public void recohereKey(K key, int version)
    • 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<K>
    • 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<K>
    • recohere

      public void recohere(int version)
    • willDecohereKey

      protected void willDecohereKey(K key, KeyEffect effect)
    • onDecohereKey

      protected void onDecohereKey(K key, KeyEffect effect)
    • didDecohereKey

      protected void didDecohereKey(K key, KeyEffect effect)
    • willDecohere

      protected void willDecohere()
    • onDecohere

      protected void onDecohere()
    • didDecohere

      protected void didDecohere()
    • willRecohereKey

      protected void willRecohereKey(K key, KeyEffect effect, int version)
    • onRecohereKey

      protected void onRecohereKey(K key, KeyEffect effect, int version)
    • didRecohereKey

      protected void didRecohereKey(K key, KeyEffect effect, int version)
    • willRecohere

      protected void willRecohere(int version)
    • onRecohere

      protected void onRecohere(int version)
    • didRecohere

      protected void didRecohere(int version)