congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
EventDispatcher.addListener
Code IndexAdd Tabnine to your IDE (free)

How to use
addListener
method
in
com.github.rinde.rinsim.event.EventDispatcher

Best Java code snippets using com.github.rinde.rinsim.event.EventDispatcher.addListener (Showing top 12 results out of 315)

origin: com.github.rinde/rinsim-event

@Override
public void addListener(Listener listener,
  Iterable<? extends Enum<?>> eventTypes) {
 ref.addListener(listener, eventTypes);
}
origin: rinde/RinSim

@Override
public void addListener(Listener listener,
  Iterable<? extends Enum<?>> eventTypes) {
 ref.addListener(listener, eventTypes);
}
origin: com.github.rinde/rinlog

@Override
public void addUpdateListener(Listener l) {
 eventDispatcher.addListener(l, CommunicatorEventType.CHANGE);
}
origin: com.github.rinde/rinlog

@Override
public void addUpdateListener(Listener l) {
 eventDispatcher.addListener(l, CommunicatorEventType.CHANGE);
}
origin: com.github.rinde/rinsim-event

@Override
public void addListener(Listener l, Enum<?>... eventTypes) {
 ref.addListener(l, eventTypes);
}
origin: rinde/RinSim

@Override
public void addListener(Listener l, Enum<?>... eventTypes) {
 ref.addListener(l, eventTypes);
}
origin: rinde/RinSim

@Test(expected = IllegalArgumentException.class)
public void addListenerFail3() {
 dispatcher.addListener(l1, OTHER_EVENT1);
}
origin: rinde/RinSim

@Test(expected = NullPointerException.class)
public void addListenerFail6() {
 dispatcher.addListener(l1, new Enum<?>[] {EVENT2, null, EVENT3});
}
origin: rinde/RinSim

@Test
public void addListenerToAll() {
 dispatcher.addListener(l1, new Enum<?>[] {});
 assertTrue(dispatcher.containsListener(l1, EVENT1));
 assertTrue(dispatcher.containsListener(l1, EVENT2));
 assertTrue(dispatcher.containsListener(l1, EVENT3));
}
origin: rinde/RinSim

assertFalse(dispatcher.hasListenerFor(OTHER_EVENT1));
dispatcher.addListener(l1, EVENT1);
assertTrue(dispatcher.hasListenerFor(EVENT1));
assertFalse(dispatcher.hasListenerFor(EVENT2));
assertFalse(dispatcher.hasListenerFor(EVENT3));
dispatcher.addListener(l3, EVENT1, EVENT2, EVENT3);
assertTrue(dispatcher.hasListenerFor(EVENT1));
assertFalse(dispatcher.hasListenerFor(OTHER_EVENT1));
origin: rinde/RinSim

@Test
public void removeListener() {
 dispatcher.addListener(l1, EVENT1);
 dispatcher.addListener(l2, EVENT3, EVENT2);
 dispatcher.addListener(l3, EVENT1, EVENT3);
 assertTrue(dispatcher.containsListener(l1, EVENT1));
 assertFalse(dispatcher.containsListener(l1, EVENT2));
 assertFalse(dispatcher.containsListener(l1, EVENT3));
 assertFalse(dispatcher.containsListener(l1, OTHER_EVENT1));
 assertFalse(dispatcher.containsListener(l2, EVENT1));
 assertTrue(dispatcher.containsListener(l2, EVENT2));
 assertTrue(dispatcher.containsListener(l2, EVENT3));
 assertFalse(dispatcher.containsListener(l2, OTHER_EVENT1));
 assertTrue(dispatcher.containsListener(l3, EVENT1));
 assertFalse(dispatcher.containsListener(l3, EVENT2));
 assertTrue(dispatcher.containsListener(l3, EVENT3));
 assertFalse(dispatcher.containsListener(l3, OTHER_EVENT1));
 dispatcher.removeListener(l2, EVENT2, EVENT3);
 assertFalse(dispatcher.containsListener(l2, EVENT1));
 assertFalse(dispatcher.containsListener(l2, EVENT2));
 assertFalse(dispatcher.containsListener(l2, EVENT3));
 assertFalse(dispatcher.containsListener(l2, OTHER_EVENT1));
}
origin: rinde/RinSim

@Test
public void removeListenerForAllTypes() {
 dispatcher.addListener(l1, EVENT1);
 dispatcher.addListener(l2, EVENT1, EVENT2);
 api.addListener(l3, EVENT1, EVENT2, EVENT3);
com.github.rinde.rinsim.eventEventDispatcheraddListener

Popular methods of EventDispatcher

  • <init>
    Creates a new EventDispatcher instance which is capable of dispatching any Event with a type attribu
  • dispatchEvent
    Dispatch an event. Notifies all listeners that are listening for this type of event.
  • getPublicEventAPI
    This method returns the public EventAPI instance associated to this EventDispatcher. This instance c
  • hasListenerFor
    Checks if the dispatcher has a listener for the specific event type.
  • containsListener
  • removeListener
  • add
    Adds the specified listener. From now on, the specified listener will be notified of events with one
  • checkCanDispatchEventType
  • safeDispatchEvent
  • update

Popular in Java

  • Finding current android device location
  • compareTo (BigDecimal)
  • getSharedPreferences (Context)
  • getSupportFragmentManager (FragmentActivity)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now