Class CompletedTraversalBuilder

  • All Implemented Interfaces:
    TraversalBuilder,, scala.Equals, scala.Product

    public final class CompletedTraversalBuilder
    extends java.lang.Object
    implements TraversalBuilder, scala.Product,

    Returned by CompositeTraversalBuilder once all output ports of a subgraph has been wired. See comments in for more details.

    See Also:
    Serialized Form
    • Constructor Detail

      • CompletedTraversalBuilder

        public CompletedTraversalBuilder​(Traversal traversalSoFar,
                                         int inSlots,
                                         scala.collection.immutable.Map<InPort,​java.lang.Object> inToOffset,
                                         Attributes attributes,
                                         OptionVal<IslandTag> islandTag)
    • Method Detail

      • $lessinit$greater$default$5

        public static OptionVal<IslandTag> $lessinit$greater$default$5()
      • traversalSoFar

        public Traversal traversalSoFar()
      • 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
      • inToOffset

        public scala.collection.immutable.Map<InPort,​java.lang.Object> inToOffset()
      • 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
      • 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
      • 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
      • 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
      • 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
      • 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
      • 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
      • copy$default$1

        public Traversal copy$default$1()
      • copy$default$2

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

        public scala.collection.immutable.Map<InPort,​java.lang.Object> 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
      • productElementName

        public java.lang.String productElementName​(int x$1)
      • hashCode

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

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

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