Package ej.event

Class EventQueueMock


  • public class EventQueueMock
    extends java.lang.Object
    EventQueueMockAPI mocks the C API of the Generic Event Foundation Library.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int offerEvent​(int type, int data)
      Inserts an event to the FIFO.
      static int offerExtendedEvent​(int type, byte[] data, int dataLength)
      Inserts an extended event to the FIFO.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • offerEvent

        public static int offerEvent​(int type,
                                     int data)
        Inserts an event to the FIFO.

        The type must not be lower than 0 or higher than 127. The data must not exceed 24-bit. Otherwise use offerExtendedEvent(int, byte[], int).

        Parameters:
        type - the type of the event.
        data - the data of the event.
        Returns:
        0 if success, -1 if failed because of illegal arguments, -2 if failed because the FIFO is full.
      • offerExtendedEvent

        public static int offerExtendedEvent​(int type,
                                             byte[] data,
                                             int dataLength)
        Inserts an extended event to the FIFO.

        The type must not be lower than 0 or higher than 127. The data_length must not exceed 24-bit.

        Parameters:
        type - the type of the events.
        data - the data of the events.
        dataLength - the length of data array (in bytes).
        Returns:
        0 if success, -1 if failed because of illegal arguments, -2 if failed because the FIFO is full.