Interface Socket<T>

    • Method Detail

      • getSocketHint

        SocketHint<T> getSocketHint()
        Returns:
        A hint at what sort of data is in this socket.
      • setValueOptional

        void setValueOptional​(java.util.Optional<? extends T> optionalValue)
        Set the value of the socket using an Optional, and fire off a SocketChangedEvent.
        Parameters:
        optionalValue - The optional value to assign this socket to.
      • onValueChanged

        default void onValueChanged()
        Called when the value for the socket is reassigned. Can be used by an implementing class to change behaviour when the value is changed.
      • flagChanged

        default void flagChanged()
        Notifies this socket that the value changed. This is usually only needed for sockets that contain mutable data such as images or other native classes (Point, Size, etc) that are written to by OpenCV operations.
      • getValue

        java.util.Optional<T> getValue()
        Returns:
        The value currently stored in this socket.
      • setValue

        default void setValue​(@Nullable
                              T value)
        Set the value of the socket, and fire off a SocketChangedEvent.
        Parameters:
        value - The value to store in this socket. Nullable.
      • getStep

        java.util.Optional<Step> getStep()
        If this socket is in a step return it.
        Returns:
        The step that this socket is part of
        See Also:
        getSource()
      • setStep

        void setStep​(java.util.Optional<Step> step)
        Parameters:
        step - The step that this socket is part of, if it's in a step.
      • getSource

        java.util.Optional<Source> getSource()
        If this socket is in a source return it.
        Returns:
        The source that this socket is part of.
        See Also:
        getStep()
      • setSource

        void setSource​(java.util.Optional<Source> source)
        Parameters:
        source - The source that this socket is part of, if it's in a source.
      • getDirection

        Socket.Direction getDirection()
        INPUT if this is the input to a step, OUTPUT if this is the output of a step or source.
        Returns:
        The direction of the socket.
      • getConnections

        java.util.Set<Connection> getConnections()
        Returns:
        The set of connections that have this socket as an input or output.
      • addConnection

        void addConnection​(Connection connection)
        Adds a connection to the socket.
        Parameters:
        connection - The connection to add to this socket.
      • removeConnection

        void removeConnection​(Connection connection)
        Removes a connnection from this socket.
        Parameters:
        connection - The connection to remove from this socket.
      • simpleString

        default java.lang.String simpleString()
        Creates a simple text representation of this socket in the format {owner type}/{owner name}/{identifier}, e.g. Step/Blur/Input or Source/Webcam 0/Image.
        Returns:
        a simple string representation of this socket.