Module logicng

Class TimeoutHandler

    • Field Detail

      • timeout

        protected long timeout
      • designatedEnd

        protected long designatedEnd
    • Constructor Detail

      • TimeoutHandler

        public TimeoutHandler​(long timeout,
                              TimeoutHandler.TimerType type)
        Constructs a new abstract timeout handler with a given timeout and a timeout type. The interpretation of the timeout depends on the timeout type: Note that it might take a few milliseconds more until the computation is actually canceled, since the cancellation depends on the next call to the handler.
        Parameters:
        timeout - the timeout in milliseconds, its meaning is defined by the timeout type
        type - the type of the timer, must not be null
      • TimeoutHandler

        public TimeoutHandler​(long timeout)
        Constructs a new abstract timeout handler with a given timeout and uses the timeout type TimeoutHandler.TimerType.SINGLE_TIMEOUT. Thus, the timeout is started when Handler.started() is called and further calls to Handler.started() have no effect on the timeout.
        Parameters:
        timeout - the timeout in milliseconds
    • Method Detail

      • timeLimitExceeded

        protected boolean timeLimitExceeded()
        Tests if the current time exceeds the timeout limit.
        Returns:
        true if the current time exceeds the timeout limit, otherwise false