Class Tuple2Future<E,​F>

    • Constructor Detail

      • Tuple2Future

        public Tuple2Future()
        Create a future that is already done.
        Parameters:
        result - The result, if any.
      • Tuple2Future

        public Tuple2Future​(E result1,
                            F result2)
        Create a future that is already done.
        Parameters:
        result - The result, if any.
      • Tuple2Future

        public Tuple2Future​(java.lang.Exception exception)
        Create a future that is already done (failed).
        Parameters:
        exception - The exception.
    • Method Detail

      • getFirstResult

        public E getFirstResult​(ThreadSuspendable sus)
        Deprecated.
        - From 3.0. Use method without suspendable. Will NOT use the suspendable that is supplied as parameter. Get the first result.
        Specified by:
        getFirstResult in interface ITuple2Future<E,​F>
        Returns:
        The next intermediate result.
      • getFirstResult

        public E getFirstResult()
        Get the first result.
        Specified by:
        getFirstResult in interface ITuple2Future<E,​F>
        Returns:
        The next intermediate result.
      • getSecondResult

        public F getSecondResult()
        Get the second result.
        Specified by:
        getSecondResult in interface ITuple2Future<E,​F>
        Returns:
        The next intermediate result.
      • getFirstResult

        public E getFirstResult​(long timeout)
        Get the first result.
        Specified by:
        getFirstResult in interface ITuple2Future<E,​F>
        Parameters:
        timeout - The timeout in millis.
        Returns:
        The next intermediate result.
      • getSecondResult

        public F getSecondResult​(long timeout)
        Get the second result.
        Specified by:
        getSecondResult in interface ITuple2Future<E,​F>
        Parameters:
        timeout - The timeout in millis.
        Returns:
        The next intermediate result.
      • getFirstResult

        public E getFirstResult​(long timeout,
                                boolean realtime)
        Get the first result.
        Specified by:
        getFirstResult in interface ITuple2Future<E,​F>
        Parameters:
        timeout - The timeout in millis.
        realtime - Flag if wait should be realtime (in contrast to simulation time).
        Returns:
        The next intermediate result.
      • getSecondResult

        public F getSecondResult​(long timeout,
                                 boolean realtime)
        Get the second result.
        Specified by:
        getSecondResult in interface ITuple2Future<E,​F>
        Parameters:
        timeout - The timeout in millis.
        realtime - Flag if wait should be realtime (in contrast to simulation time).
        Returns:
        The next intermediate result.
      • setFirstResult

        public void setFirstResult​(E result)
        Set the result. Listener notifications occur on calling thread of this method.
        Parameters:
        result - The result.
      • setSecondResult

        public void setSecondResult​(F result)
        Set the result. Listener notifications occur on calling thread of this method.
        Parameters:
        result - The result.
      • setFirstResultIfUndone

        public void setFirstResultIfUndone​(E result)
        Set the result. Listener notifications occur on calling thread of this method.
        Parameters:
        result - The result.
      • setSecondResultIfUndone

        public void setSecondResultIfUndone​(F result)
        Set the result. Listener notifications occur on calling thread of this method.
        Parameters:
        result - The result.
      • setXResult

        protected void setXResult​(int idx,
                                  java.lang.Object res)
        Set the xth result.
      • setXResultIfUndone

        protected void setXResultIfUndone​(int idx,
                                          java.lang.Object res)
        Set the xth result.
      • getXResult

        protected java.lang.Object getXResult​(int idx,
                                              long timeout,
                                              boolean realtime)
        Get the x result.
        Returns:
        The next intermediate result.
      • findResult

        protected TupleResult findResult​(int idx)
        Find result in results
      • getMax

        protected int getMax()
        Get the number of results of the type of future..