Get a specific event type
@param events The events
@param identifier The connection listener
@param types The types
@return The first event type found; otherwise <code>null</code> if none
559019
public static TraceEvent getType(List<TraceEvent> events, String identifier, int... types)
   {
      for (TraceEvent te : events)
      {
         for (int type : types)
         {
            if (te.getType() == type && (identifier == null || te.getConnectionListener().equals(identifier)))
               return te;
         }
      }

      return null;
   }
759672
public long getTotalTime(IoEventType type) {
        switch (type) {
            case MESSAGE_RECEIVED :
                if (profileMessageReceived) {
                    return messageReceivedTimerWorker.getTotal();
                }
                
                break;
                
            case MESSAGE_SENT :
                if (profileMessageSent) {
                    return messageSentTimerWorker.getTotal();
                }
                
                break;
                
            case SESSION_CREATED :
                if (profileSessionCreated) {
                    return sessionCreatedTimerWorker.getTotal();
                }
                
                break;
                
            case SESSION_OPENED :
                if (profileSessionOpened) {
                    return sessionOpenedTimerWorker.getTotal();
                }
                
                break;
                
            case SESSION_IDLE :
                if (profileSessionIdle) {
                    return sessionIdleTimerWorker.getTotal();
                }
                
                break;
                
            case SESSION_CLOSED :
                if (profileSessionClosed) {
                    return sessionClosedTimerWorker.getTotal();
                }
                
                break;
        }
    
        throw new IllegalArgumentException(
                "You are not monitoring this event.  Please add this event first.");
    }
1147430
public EventType getType() {
        String typeStr = getTypeString();
        EventType type = null;
        try {
            type = EventType.valueOf(typeStr);
        } catch (Exception ex) {
            logger.warn("Unexpected type: " + typeStr);
        }
        return type;
    }
619932
private ArrayList<AptEventSet> initEventSets()
    {
        ArrayList<AptEventSet> eventSets = new ArrayList<AptEventSet>();

        if ( _intfDecl == null || _intfDecl.getNestedTypes() == null )
            return eventSets;

        for (TypeDeclaration innerDecl : _intfDecl.getNestedTypes())
        {
            // HACKHACK: There appear to be mirror API bugs where calling getAnnotation()
            // on certain entity types will result in an endless loop.  For now, work around
            // this by a priori filtering... but this mechanism will drop errors that appear
            // on an inapropriate type (see check below)
            if (! (innerDecl instanceof InterfaceDeclaration))
                continue;

            if (innerDecl.getAnnotation(EventSet.class) != null)
            {

                if (! (innerDecl instanceof InterfaceDeclaration))
                {
                    _ap.printError( innerDecl, "eventset.illegal.usage" );
                }
                else
                {
                    eventSets.add(
                        new AptEventSet(this, (InterfaceDeclaration)innerDecl, _ap));
                }
            }
        }
        return eventSets;
    }
977040
private static void checkEventType(String eventSetName,
            Method listenerMethod) throws IntrospectionException {
        Class<?>[] params = listenerMethod.getParameterTypes();
        String firstParamTypeName = null;
        String eventTypeName = prepareEventTypeName(eventSetName);

        if (params.length > 0) {
            firstParamTypeName = extractShortClassName(params[0]
                    .getName());
        }

        if (firstParamTypeName == null
                || !firstParamTypeName.equals(eventTypeName)) {
            throw new IntrospectionException("Listener method " +
                    listenerMethod.getName() + " should have parameter of type " + eventTypeName);
        }
    }
306970
function( type ) {
                var args, events, allEvents;
    
                if ( !this._events || !type ) {
                    return this;
                }
    
                args = slice.call( arguments, 1 );
                events = findHandlers( this._events, type );
                allEvents = findHandlers( this._events, 'all' );
    
                return triggerHanders( events, args ) &&
                        triggerHanders( allEvents, arguments );
            }
963559
function _getEventHandler (event, eventsHandler) {
    var scope = event.scope,
        eventHandler;
    if ("function" === typeof eventsHandler.dispatchEvent) {
        // Event dispatcher expected interface
        return eventsHandler.dispatchEvent.bind(eventsHandler);
    }
    if ("function" === typeof eventsHandler) {
        return eventsHandler.bind(scope);
    }
    // Composite with a specific event handler
    eventHandler = eventsHandler[event.type] || eventsHandler["*"] || _gpfEmptyFunc;
    return eventHandler.bind(eventsHandler.scope || eventsHandler);
}
445989
public static <T extends GenericEvent> GenericEventType getTypeOf(Class<T> clazz) {
    
    GenericEventType eventType = TYPE_MAP.get(clazz);
    
    if (eventType == null) {
      eventType = new GenericEventType();
      TYPE_MAP.put(clazz, eventType);
    }
    
    return eventType;
  }
836987
@Nullable
    public <P> P getListener(Class<P> type) {
        if (mListener != null) {
            return type.cast(mListener);
        }
        return null;
    }
957358
public String getEventDescriptor(Class controlInterface)
    {
        //
        // NOTE: The input controlInterface is currently unused, but included to
        // enable downstream optimization of serialization representation.  See the
        // OPTIMIZE comment below for more details.  If implemented, the interface
        // is needed to reverse the transformation from a hash back to a method or
        // descriptor.
        //
        if (_descriptor == null)
            _descriptor = computeEventDescriptor(_method);

        return _descriptor;
    }
1276462
@Override
    public void onEvent(final javax.jcr.observation.EventIterator events) {
        Session lookupSession = null;
        try {
            lookupSession = getJcrSession(repository.login());

            @SuppressWarnings("unchecked")
            final Iterator<Event> filteredEvents = filter(events, eventFilter::test);
            eventMapper.apply(iteratorToStream(filteredEvents))
                .map(filterAndDerefResourceTypes(lookupSession))
                .flatMap(handleMoveEvents(lookupSession))
                .forEach(this::post);
        } finally {
            if (lookupSession != null) {
                lookupSession.logout();
            }
        }
    }
1371484
private static EventTypeEnum mapEventTypeEnum(EventEnumType eventType) {
        if (eventType != null) {
            return EventTypeEnum.valueOf(eventType.name());
        }
        return EventTypeEnum.UNKNOWN;
    }
1172805
public final void sinkEvents(Widget widget, Set<String> typeNames) {
    if (typeNames == null) {
      return;
    }

    int eventsToSink = 0;
    for (String typeName : typeNames) {
      int typeInt = Event.getTypeInt(typeName);
      if (typeInt < 0) {
        widget.sinkBitlessEvent(typeName);
      } else {
        typeInt = sinkEvent(widget, typeName);
        if (typeInt > 0) {
          eventsToSink |= typeInt;
        }
      }
    }
    if (eventsToSink > 0) {
      widget.sinkEvents(eventsToSink);
    }
  }
318801
@Override
   public List<EventLog> getEvents(Instant start, int count, Optional<EventLogCategory> category, Optional<EventLogLevel> level) {
      return Collections.emptyList();
   }
232477
function getEventObject(eventObjects, eventType, listener) {
        var i, numberOfEvents = eventObjects.length;

        for (i = 0; i < numberOfEvents; i += 1) {
            if (isValueEqualToValue(eventObjects[i].type, eventType) &&
                    isValueEqualToValue(eventObjects[i].callback, listener)) {
                return eventObjects[i];
            }
        }

        return null;
    }
242823
protected int getCount(int type, Collection<ConnectionListener> listeners)
   {
      int count = 0;

      for (ConnectionListener cl : listeners)
      {
         if (cl.getState() == type)
            count++;
      }

      return count;
   }
1277742
function(eventType, listener) {
    var i, len, foundIndex, events, perEventHandlers;
    if (arguments.length === 0) {
      events = _keys(_handlers);
    } else if (typeof eventType === "string" && eventType) {
      events = eventType.toLowerCase().split(/\s+/);
    } else if (typeof eventType === "object" && eventType && !("length" in eventType) && typeof listener === "undefined") {
      _keys(eventType).forEach(function(key) {
        var listener = eventType[key];
        if (typeof listener === "function") {
          ZeroClipboard.off(key, listener);
        }
      });
    }
    if (events && events.length) {
      for (i = 0, len = events.length; i < len; i++) {
        eventType = events[i].replace(/^on/, "");
        perEventHandlers = _handlers[eventType];
        if (perEventHandlers && perEventHandlers.length) {
          if (listener) {
            foundIndex = perEventHandlers.indexOf(listener);
            while (foundIndex !== -1) {
              perEventHandlers.splice(foundIndex, 1);
              foundIndex = perEventHandlers.indexOf(listener, foundIndex);
            }
          } else {
            perEventHandlers.length = 0;
          }
        }
      }
    }
    return ZeroClipboard;
  }