Tabnine Logo
ListenableCollection.add
Code IndexAdd Tabnine to your IDE (free)

How to use
add
method
in
com.ochafik.util.listenable.ListenableCollection

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

origin: com.nativelibs4java/ochafik-util

public boolean add(T o) {
  return listenableCollection.add(o);
}
origin: com.nativelibs4java/ochafik-util

@SuppressWarnings("unchecked")
void add(T t, ListenableCollection<T> source, ListenableCollection<T> recipient) {
  if ((recipient instanceof List) && (source instanceof SortedSet)) {
    ListenableList<T> recipientList = (ListenableList<T>)recipient;
    Comparator<T> comparator = (Comparator<T>) ((SortedSet)source).comparator();
    int i;
    if (comparator != null) {
      i = Collections.binarySearch(recipientList, t, comparator);
    } else {
      // Assume T is comparable
      i = Collections.binarySearch((List)recipientList, t);
    }
    if (i >= 0) {
      recipientList.set(i, t);
    } else {
      recipientList.add(-i - 1, t);
    }
  } else {
    recipient.add(t);
  }
}
@SuppressWarnings("unchecked")
origin: jtrfp/terminal-recall

  @Override
  public void propertyChange(PropertyChangeEvent evt) {
  formatList.clear();
  for(AudioFormat f:((AudioOutput)evt.getNewValue()).getFormats())
    if(isAcceptableFormat(f))
    formatList.add(f);
  }});
}//end constructor
com.ochafik.util.listenableListenableCollectionadd

Popular methods of ListenableCollection

  • addAll
  • addCollectionListener
  • clear
  • contains
  • containsAll
  • isEmpty
  • iterator
  • remove
  • removeAll
  • removeCollectionListener
  • retainAll
  • size
  • retainAll,
  • size,
  • toArray

Popular in Java

  • Making http post requests using okhttp
  • onCreateOptionsMenu (Activity)
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (Timer)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • 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