Class AtomicTraversalBuilder

  • All Implemented Interfaces:
    TraversalBuilder, java.io.Serializable, scala.Equals, scala.Product, scala.Serializable

    public final class AtomicTraversalBuilder
    extends java.lang.Object
    implements TraversalBuilder, scala.Product, scala.Serializable
    INTERNAL API

    Represents a builder that contains a single atomic module. Its primary purpose is to track and build the outToSlot array which will be then embedded in a MaterializeAtomic Traversal step. See comments in akka.stream.impl.package for more details.

    See Also:
    Serialized Form
    • Method Detail

      • outToSlot

        public int[] outToSlot()
      • unwiredOuts

        public int unwiredOuts()
        Description copied from interface: TraversalBuilder
        The number of output ports that have not been wired.
        Specified by:
        unwiredOuts in interface TraversalBuilder
        Returns:
        (undocumented)
      • add

        public TraversalBuilder add​(TraversalBuilder submodule,
                                    Shape shape,
                                    scala.Function2<scala.runtime.Nothing$,​scala.runtime.Nothing$,​java.lang.Object> combineMat)
        Description copied from interface: TraversalBuilder
        Adds a module to the builder. It is possible to add a module with a different Shape (import), in this case the ports of the shape MUST have their mappedTo field pointing to the original ports. The act of being imported will not be reflected in the final Traversal, the Shape is only used by the builder to disambiguate between multiple imported instances of the same module.

        See append in the LinearTraversalBuilder for a more efficient alternative for linear graphs.

        Specified by:
        add in interface TraversalBuilder
        Parameters:
        submodule - (undocumented)
        shape - (undocumented)
        combineMat - (undocumented)
        Returns:
        (undocumented)
      • transformMat

        public TraversalBuilder transformMat​(scala.Function1<scala.runtime.Nothing$,​java.lang.Object> f)
        Description copied from interface: TraversalBuilder
        Maps the materialized value produced by the module built-up so far with the provided function, providing a new TraversalBuilder returning the mapped materialized value.
        Specified by:
        transformMat in interface TraversalBuilder
        Parameters:
        f - (undocumented)
        Returns:
        (undocumented)
      • inSlots

        public int inSlots()
        Description copied from interface: TraversalBuilder
        The total number of input ports encountered so far. Gives the first slot to which a new input port can be assigned (if a new module is added).
        Specified by:
        inSlots in interface TraversalBuilder
        Returns:
        (undocumented)
      • offsetOfModule

        public int offsetOfModule​(OutPort out)
        Description copied from interface: TraversalBuilder
        Returns the base offset (the first number an input port would receive if there is any) of the module to which the port belongs *relative to this builder*. This is used to calculate the relative offset of output port mappings (see MaterializeAtomic).

        This method only guarantees to return the offset of modules for output ports that have not been wired.

        Specified by:
        offsetOfModule in interface TraversalBuilder
        Parameters:
        out - (undocumented)
        Returns:
        (undocumented)
      • offsetOf

        public int offsetOf​(InPort in)
        Description copied from interface: TraversalBuilder
        Returns the number assigned to a certain input port *relative* to this module.

        This method only guarantees to return the offset of input ports that have not been wired.

        Specified by:
        offsetOf in interface TraversalBuilder
        Parameters:
        in - (undocumented)
        Returns:
        (undocumented)
      • isTraversalComplete

        public boolean isTraversalComplete()
        Description copied from interface: TraversalBuilder
        Returns true if the Traversal is available. Not all builders are able to build up the Traversal incrementally. Generally a traversal is complete if there are no unwired output ports.
        Specified by:
        isTraversalComplete in interface TraversalBuilder
        Returns:
        (undocumented)
      • isUnwired

        public boolean isUnwired​(OutPort out)
        Description copied from interface: TraversalBuilder
        Returns whether the given output port has been wired in the graph or not.
        Specified by:
        isUnwired in interface TraversalBuilder
        Parameters:
        out - (undocumented)
        Returns:
        (undocumented)
      • isUnwired

        public boolean isUnwired​(InPort in)
        Description copied from interface: TraversalBuilder
        Returns whether the given input port has been wired in the graph or not.
        Specified by:
        isUnwired in interface TraversalBuilder
        Parameters:
        in - (undocumented)
        Returns:
        (undocumented)
      • wire

        public TraversalBuilder wire​(OutPort out,
                                     InPort in)
        Description copied from interface: TraversalBuilder
        Connects two unwired ports in the graph. For imported modules, use the ports of their "import shape". These ports must have their mappedTo field set and point to the original ports.

        See append in the LinearTraversalBuilder for a more efficient alternative for linear graphs.

        Specified by:
        wire in interface TraversalBuilder
        Parameters:
        out - (undocumented)
        in - (undocumented)
        Returns:
        (undocumented)
      • assign

        public TraversalBuilder assign​(OutPort out,
                                       int relativeSlot)
        Description copied from interface: TraversalBuilder
        Finish the wiring of an output port to an input port by assigning the relative slot for the output port.

        (see MaterializeAtomic for details of the resolution process)

        Specified by:
        assign in interface TraversalBuilder
        Parameters:
        out - (undocumented)
        relativeSlot - (undocumented)
        Returns:
        (undocumented)
      • makeIsland

        public TraversalBuilder makeIsland​(IslandTag islandTag)
        Description copied from interface: TraversalBuilder
        Wraps the builder in an island that can be materialized differently, using async boundaries to bridge between islands.
        Specified by:
        makeIsland in interface TraversalBuilder
        Parameters:
        islandTag - (undocumented)
        Returns:
        (undocumented)
      • copy$default$2

        public int[] copy$default$2()
      • copy$default$3

        public int copy$default$3()
      • copy$default$4

        public Attributes copy$default$4()
      • productPrefix

        public java.lang.String productPrefix()
        Specified by:
        productPrefix in interface scala.Product
      • productArity

        public int productArity()
        Specified by:
        productArity in interface scala.Product
      • productElement

        public java.lang.Object productElement​(int x$1)
        Specified by:
        productElement in interface scala.Product
      • productIterator

        public scala.collection.Iterator<java.lang.Object> productIterator()
        Specified by:
        productIterator in interface scala.Product
      • canEqual

        public boolean canEqual​(java.lang.Object x$1)
        Specified by:
        canEqual in interface scala.Equals
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object x$1)
        Specified by:
        equals in interface scala.Equals
        Overrides:
        equals in class java.lang.Object