日期:2014-05-20 浏览次数:20761 次
public static void mediate(final Event event) { final Scope scope = event.getScope(); final DecomposedRoiEntry[] values = registry.get(scope.getAreaLevelHash()); if (values != null) { final HashSet<EventConsumer> consumers = new HashSet<EventConsumer>(values.length); for (int i = 0; i < values.length; i++) { final DecomposedRoiEntry value = values[i]; if (value.hasInterest(scope)) { final EventConsumer eventConsumer = value.getEventConsumer(); if (!consumers.contains(eventConsumer)) { consumers.add(eventConsumer); eventConsumer.consume(event); } } } } }
public static void mediate(final Event event) { final Scope scope = event.getScope(); final DecomposedRoiEntry[] values = registry.get(scope.getAreaLevelHash()); if (values == null) return ; final HashSet<EventConsumer> consumers = new HashSet<EventConsumer>(values.length); for (int i = 0; i < values.length; i++) { final DecomposedRoiEntry value = values[i]; if (!value.hasInterest(scope) || consumers.contains(getEventConsumer(event))) continue; consumers.add(eventConsumer); getEventConsumer(event).consume(event); } } private static getEventConsumer(DecomposedRoiEntry value){ return value.getEventConsumer(); }