Class InputSocket.Decorator<T>

  • Type Parameters:
    T - The type of the value that this socket stores.
    All Implemented Interfaces:
    InputSocket<T>, Socket<T>
    Enclosing interface:
    InputSocket<T>

    public abstract static class InputSocket.Decorator<T>
    extends java.lang.Object
    implements InputSocket<T>
    A decorator for the InputSocket.
    • Constructor Detail

      • Decorator

        public Decorator​(InputSocket<T> socket)
        Parameters:
        socket - the decorated socket.
    • Method Detail

      • getDirection

        public Socket.Direction getDirection()
        Description copied from interface: Socket
        INPUT if this is the input to a step, OUTPUT if this is the output of a step or source.
        Specified by:
        getDirection in interface Socket<T>
        Returns:
        The direction of the socket.
      • getSource

        public java.util.Optional<Source> getSource()
        Description copied from interface: Socket
        If this socket is in a source return it.
        Specified by:
        getSource in interface Socket<T>
        Returns:
        The source that this socket is part of.
        See Also:
        Socket.getStep()
      • setSource

        public void setSource​(java.util.Optional<Source> source)
        Specified by:
        setSource in interface Socket<T>
        Parameters:
        source - The source that this socket is part of, if it's in a source.
      • getStep

        public java.util.Optional<Step> getStep()
        Description copied from interface: Socket
        If this socket is in a step return it.
        Specified by:
        getStep in interface Socket<T>
        Returns:
        The step that this socket is part of
        See Also:
        Socket.getSource()
      • setStep

        public void setStep​(java.util.Optional<Step> step)
        Specified by:
        setStep in interface Socket<T>
        Parameters:
        step - The step that this socket is part of, if it's in a step.
      • getValue

        public java.util.Optional<T> getValue()
        Specified by:
        getValue in interface Socket<T>
        Returns:
        The value currently stored in this socket.
      • addConnection

        public void addConnection​(Connection connection)
        Description copied from interface: Socket
        Adds a connection to the socket.
        Specified by:
        addConnection in interface Socket<T>
        Parameters:
        connection - The connection to add to this socket.
      • removeConnection

        public void removeConnection​(Connection connection)
        Description copied from interface: Socket
        Removes a connnection from this socket.
        Specified by:
        removeConnection in interface Socket<T>
        Parameters:
        connection - The connection to remove from this socket.
      • getConnections

        public java.util.Set<Connection> getConnections()
        Specified by:
        getConnections in interface Socket<T>
        Returns:
        The set of connections that have this socket as an input or output.
      • getSocketHint

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

        public void setValueOptional​(java.util.Optional<? extends T> optionalValue)
        Description copied from interface: Socket
        Set the value of the socket using an Optional, and fire off a SocketChangedEvent.
        Specified by:
        setValueOptional in interface Socket<T>
        Parameters:
        optionalValue - The optional value to assign this socket to.
      • dirtied

        public boolean dirtied()
        Description copied from interface: InputSocket
        Checks if the socket has been dirtied and rests it to false.
        Specified by:
        dirtied in interface InputSocket<T>
        Returns:
        True if the socket has been dirtied.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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