Tabnine Logo
ArrayList.lastIndexOf
Code IndexAdd Tabnine to your IDE (free)

How to use
lastIndexOf
method
in
java.util.ArrayList

Best Java code snippets using java.util.ArrayList.lastIndexOf (Showing top 20 results out of 864)

origin: ReactiveX/RxJava

@Override
public int lastIndexOf(Object o) {
  return list.lastIndexOf(o);
}
origin: redisson/redisson

@Override
public int lastIndexOf(Object o) {
  return list.lastIndexOf(o);
}
origin: commons-collections/commons-collections

/**
 * Search for the last occurrence of the given argument, testing
 * for equality using the <code>equals()</code> method, and return
 * the corresponding index, or -1 if the object is not found.
 *
 * @param element The element to search for
 */
public int lastIndexOf(Object element) {
  if (fast) {
    return (list.lastIndexOf(element));
  } else {
    synchronized (list) {
      return (list.lastIndexOf(element));
    }
  }
}
origin: ltsopensource/light-task-scheduler

public int lastIndexOf(Object o) {
  return list.lastIndexOf(o);
}
origin: ltsopensource/light-task-scheduler

public int lastIndexOf(Object o) {
  return list.lastIndexOf(o);
}
origin: wildfly/wildfly

/**
 * Search for the last occurrence of the given argument, testing
 * for equality using the <code>equals()</code> method, and return
 * the corresponding index, or -1 if the object is not found.
 *
 * @param element The element to search for
 */
public int lastIndexOf(Object element) {
  if (fast) {
    return (list.lastIndexOf(element));
  } else {
    synchronized (list) {
      return (list.lastIndexOf(element));
    }
  }
}
origin: spotbugs/spotbugs

public void test3NoBugs(ArrayList<? extends CharSequence> list) {
  list.lastIndexOf(new StringBuffer("Key"));
}
origin: spotbugs/spotbugs

public void test3Bugs(ArrayList<? extends CharSequence> list) {
  list.lastIndexOf(Integer.valueOf(3));
}
origin: org.jsoup/jsoup

void insertOnStackAfter(Element after, Element in) {
  int i = stack.lastIndexOf(after);
  Validate.isTrue(i != -1);
  stack.add(i+1, in);
}
origin: org.jsoup/jsoup

private void replaceInQueue(ArrayList<Element> queue, Element out, Element in) {
  int i = queue.lastIndexOf(out);
  Validate.isTrue(i != -1);
  queue.set(i, in);
}
origin: rubenlagus/TelegramBots

public int lastIndexOf(String text) {
  return super.lastIndexOf(new KeyboardButton(text));
}
origin: cmusphinx/sphinx4

/**
 * Calculates the coaccessible states of an fst
 */
private static void calcCoAccessible(Fst fst, State state,
    ArrayList<ArrayList<State>> paths, HashSet<State> coaccessible) {
  // hold the coaccessible added in this loop
  ArrayList<State> newCoAccessibles = new ArrayList<State>();
  for (ArrayList<State> path : paths) {
    int index = path.lastIndexOf(state);
    if (index != -1) {
      if (state.getFinalWeight() != fst.getSemiring().zero()
          || coaccessible.contains(state)) {
        for (int j = index; j > -1; j--) {
          if (!coaccessible.contains(path.get(j))) {
            newCoAccessibles.add(path.get(j));
            coaccessible.add(path.get(j));
          }
        }
      }
    }
  }
  // run again for the new coaccessibles
  for (State s : newCoAccessibles) {
    calcCoAccessible(fst, s, paths, coaccessible);
  }
}
origin: geotools/geotools

/**
 * Returns the index of the last occurrence of the specified element in this list, or -1 if
 * none.
 */
@Override
public int lastIndexOf(Object o) {
  synchronized (getLock()) {
    return super.lastIndexOf(o);
  }
}
origin: biojava/biojava

/**
 *
 * @param compound
 * @return
 */
@Override
public int getLastIndexOf(C compound) {
  return this.parsedCompounds.lastIndexOf(compound) + 1;
}
origin: graphstream/gs-core

/**
 * Remove a style change listener.
 * 
 * @param listener
 *            The listener to remove.
 */
public void removeListener(StyleGroupListener listener) {
  int index = listeners.lastIndexOf(listener);
  if (index >= 0) {
    listeners.remove(index);
  }
}
origin: org.graphstream/gs-core

/**
 * Remove an event from the set.
 * 
 * @param event
 *            The event to remove.
 */
public void popEvent(String event) {
  int index = eventSet.lastIndexOf(event);
  if (index >= 0)
    eventSet.remove(index);
  events = eventSet.toArray(events);
}
origin: io.snappydata/gemfirexd

void remove(Context context) {
  if (context == top_) {
    pop();
    return;
  }
  stack_.remove(stack_.lastIndexOf(context)); 
}
Context top() { 
origin: com.vaadin.external.jsoup/jsoup-case-sensitive

void insertOnStackAfter(Element after, Element in) {
  int i = stack.lastIndexOf(after);
  Validate.isTrue(i != -1);
  stack.add(i+1, in);
}
origin: itext/itext7

private void replaceInQueue(ArrayList<Element> queue, Element out, Element in) {
  int i = queue.lastIndexOf(out);
  Validate.isTrue(i != -1);
  queue.set(i, in);
}
origin: org.compass-project/compass

public int lastIndexOf(Object o) {
  if (fullyLoaded) {
    return objectList.lastIndexOf(o);
  }
  return super.lastIndexOf(o);
}
java.utilArrayListlastIndexOf

Javadoc

Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element. More formally, returns the highest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.

Popular methods of ArrayList

  • <init>
  • add
  • size
    Returns the number of elements in this ArrayList.
  • get
    Returns the element at the specified position in this list.
  • toArray
    Returns an array containing all of the elements in this list in proper sequence (from first to last
  • addAll
    Adds the objects in the specified collection to this ArrayList.
  • remove
    Removes the first occurrence of the specified element from this list, if it is present. If the list
  • clear
    Removes all elements from this ArrayList, leaving it empty.
  • isEmpty
    Returns true if this list contains no elements.
  • iterator
    Returns an iterator over the elements in this list in proper sequence.The returned iterator is fail-
  • contains
    Searches this ArrayList for the specified object.
  • set
    Replaces the element at the specified position in this list with the specified element.
  • contains,
  • set,
  • indexOf,
  • clone,
  • subList,
  • stream,
  • ensureCapacity,
  • trimToSize,
  • removeAll,
  • toString

Popular in Java

  • Reading from database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • findViewById (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • JTextField (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top Sublime Text plugins
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