Codota Logo
CollectionEvent.getFirstIndex
Code IndexAdd Codota to your IDE (free)

How to use
getFirstIndex
method
in
com.ochafik.util.listenable.CollectionEvent

Best Java code snippets using com.ochafik.util.listenable.CollectionEvent.getFirstIndex (Showing top 3 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: com.nativelibs4java/ochafik-util

  public void collectionChanged(CollectionEvent<T> e) {
    switch (e.getType()) {
    case ADDED:
      fireIntervalAdded(this, e.getFirstIndex(), e.getLastIndex());
      break;
    case REMOVED:
      fireIntervalRemoved(this, e.getFirstIndex(), e.getLastIndex());
      break;
    case UPDATED:
      fireContentsChanged(this, e.getFirstIndex(), e.getLastIndex());
      break;
    }
  }
});
origin: com.nativelibs4java/ochafik-util

  public void collectionChanged(CollectionEvent<T> e) {
    if (listeners != null && !listeners.isEmpty()) {
      Collection<T> filteredElements = e.getElements();
      CollectionEvent<T> filteredEvent = new CollectionEvent<T>(FilteredListenableCollection.this, filteredElements, e.getType(), e.getFirstIndex(), e.getLastIndex());
      for (CollectionListener<T> listener : listeners) {
        listener.collectionChanged(filteredEvent);
      }
    }
  }
});
origin: com.nativelibs4java/ochafik-util

  public void collectionChanged(CollectionEvent<U> e) {
    // Do not propagate the event if we triggered it
    if (currentlyCausingChange)
      return;
    
    // Only propagate if someone is listening (CollectionSupport already tries not to fire anything when there is no listener, but here we are trying to avoid to create the wrapped elements collection)
    if (collectionSupport == null || !collectionSupport.hasListeners())
      return;
    
    // Adapt the collection of changed / added / removed elements in the event
    collectionSupport.fireEvent(
      AdaptedCollection.this, 
      new AdaptedCollection<U, V>(e.getElements(), AdaptedCollection.this.forwardAdapter, AdaptedCollection.this.backwardAdapter), 
      e.getType(), 
      e.getFirstIndex(), 
      e.getLastIndex());
  }
});
com.ochafik.util.listenableCollectionEventgetFirstIndex

Javadoc

Get the index of the first affected element in the source, or -1 if not applicable

Popular methods of CollectionEvent

  • getElements
    Get the elements affected by the event.
  • getType
    Get the event type
  • <init>
  • getLastIndex
    Get the index of the last affected element in the source, or -1 if not applicable
  • getSource

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSystemService (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • getApplicationContext (Context)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • DecimalFormat (java.text)
    DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
  • JTable (javax.swing)
  • Join (org.hibernate.mapping)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now