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

How to use
lastIndexOf
method
in
java.util.List

Best Java code snippets using java.util.List.lastIndexOf (Showing top 20 results out of 6,777)

origin: spring-projects/spring-framework

@Override
public int lastIndexOf(Object o) {
  return this.backingList.lastIndexOf(o);
}
origin: hankcs/HanLP

@Override
public int lastIndexOf(Object o)
{
  return pipeList.lastIndexOf(o);
}
origin: apache/flink

@Override
public int lastIndexOf(final Object o) {
  return this.list.lastIndexOf(o);
}
origin: stanfordnlp/CoreNLP

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

/**
 * Use {@link #getResponses()}
 */
@Deprecated
public int lastIndexOf(Object o) {
  return responses.lastIndexOf(o);
}
origin: redisson/redisson

/**
 * Use {@link #getResponses()}
 */
@Deprecated
public int lastIndexOf(Object o) {
  return responses.lastIndexOf(o);
}
origin: google/guava

@Override
public int lastIndexOf(Object o) {
 synchronized (mutex) {
  return delegate().lastIndexOf(o);
 }
}
origin: google/guava

@Override
protected int find(Object o) {
 return getList().lastIndexOf(o);
}
origin: google/guava

@Override
public int lastIndexOf(Object element) {
 return delegate().lastIndexOf(element);
}
origin: spring-projects/spring-framework

@Override
public int lastIndexOf(Object o) {
  return this.children.lastIndexOf(o);
}
origin: spring-projects/spring-framework

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

private void cutCycleAt(String referee, List<String> cycle) {
  // cycle contains variables in referrer-to-referee order.
  // This should not be negative, for the first and last one is same.
  int refererIndex = cycle.lastIndexOf(referee) - 1;
  
  assert(refererIndex >= 0);
  String referrer = cycle.get(refererIndex);
  boolean removed = refereeSetMap.get(referrer).remove(referee);
  assert(removed);
  LOGGER.warning(String.format("Cyclic reference detected: %s", Util.join(cycle," -> ")));
  LOGGER.warning(String.format("Cut the reference %s -> %s", referrer, referee));
}

origin: greenrobot/greenDAO

@Override
public int lastIndexOf(Object object) {
  loadRemaining();
  return entities.lastIndexOf(object);
}
origin: google/guava

@CollectionSize.Require(absent = {ZERO, ONE})
public void testSubList_lastIndexOf() {
 List<E> list = getList();
 int size = list.size();
 List<E> copy = list.subList(0, size);
 List<E> head = list.subList(0, size - 1);
 List<E> tail = list.subList(1, size);
 assertEquals(size - 1, copy.lastIndexOf(list.get(size - 1)));
 assertEquals(size - 2, head.lastIndexOf(list.get(size - 2)));
 assertEquals(size - 2, tail.lastIndexOf(list.get(size - 1)));
 // The following assumes all elements are distinct.
 assertEquals(0, copy.lastIndexOf(list.get(0)));
 assertEquals(0, head.lastIndexOf(list.get(0)));
 assertEquals(0, tail.lastIndexOf(list.get(1)));
 assertEquals(-1, head.lastIndexOf(list.get(size - 1)));
 assertEquals(-1, tail.lastIndexOf(list.get(0)));
}
origin: prestodb/presto

@Override
public int lastIndexOf(Object o) {
 synchronized (mutex) {
  return delegate().lastIndexOf(o);
 }
}
origin: prestodb/presto

@Override
public int lastIndexOf(Object element) {
 return delegate().lastIndexOf(element);
}
origin: google/j2objc

@Override
public int lastIndexOf(Object o) {
 synchronized (mutex) {
  return delegate().lastIndexOf(o);
 }
}
origin: google/guava

public void testAsListLastIndexOf() {
 assertEquals(-1, Booleans.asList(EMPTY).lastIndexOf((Object) "wrong type"));
 assertEquals(-1, Booleans.asList(EMPTY).lastIndexOf(true));
 assertEquals(-1, Booleans.asList(ARRAY_FALSE).lastIndexOf(true));
 assertEquals(1, Booleans.asList(ARRAY_FALSE_TRUE).lastIndexOf(true));
 assertEquals(1, Booleans.asList(ARRAY_FALSE_FALSE).lastIndexOf(false));
}
origin: google/guava

 @CollectionFeature.Require(absent = REJECTS_DUPLICATES_AT_CREATION)
 @CollectionSize.Require(absent = {ZERO, ONE})
 public void testLastIndexOf_duplicate() {
  E[] array = createSamplesArray();
  array[getNumElements() / 2] = e0();
  collection = getSubjectGenerator().create(array);
  assertEquals(
    "lastIndexOf(duplicate) should return index of last occurrence",
    getNumElements() / 2,
    getList().lastIndexOf(e0()));
 }
}
origin: google/guava

public void testAsListEquals() {
 assertEquals(Booleans.asList(EMPTY), Collections.emptyList());
 assertEquals(Booleans.asList(ARRAY_FALSE), Booleans.asList(ARRAY_FALSE));
 assertFalse(Booleans.asList(ARRAY_FALSE).equals(ARRAY_FALSE));
 assertFalse(Booleans.asList(ARRAY_FALSE).equals(null));
 assertFalse(Booleans.asList(ARRAY_FALSE).equals(Booleans.asList(ARRAY_FALSE_TRUE)));
 assertFalse(Booleans.asList(ARRAY_FALSE_FALSE).equals(Booleans.asList(ARRAY_FALSE_TRUE)));
 assertEquals(1, Booleans.asList(ARRAY_FALSE_TRUE).lastIndexOf(true));
 List<Boolean> reference = Booleans.asList(ARRAY_FALSE);
 assertEquals(Booleans.asList(ARRAY_FALSE), reference);
 assertEquals(reference, reference);
}
java.utilListlastIndexOf

Javadoc

Searches this List for the specified object and returns the index of the last occurrence.

Popular methods of List

  • add
  • size
    Returns the number of elements in this List.
  • get
    Returns the element at the specified location in this List.
  • isEmpty
    Returns whether this List contains no elements.
  • addAll
  • toArray
    Returns an array containing all elements contained in this List. If the specified array is large eno
  • contains
    Tests whether this List contains the specified object.
  • remove
    Removes the first occurrence of the specified object from this List.
  • iterator
    Returns an iterator on the elements of this List. The elements are iterated in the same order as the
  • clear
  • stream
  • forEach
  • stream,
  • forEach,
  • set,
  • subList,
  • indexOf,
  • equals,
  • hashCode,
  • removeAll,
  • listIterator,
  • sort

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (Timer)
  • startActivity (Activity)
  • getApplicationContext (Context)
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Best plugins for Eclipse
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