/** {@inheritDoc} */ @Override public int lastIndexOf(Object object) { return source.lastIndexOf(object); }
/** {@inheritDoc} */ @Override public int lastIndexOf(Object object) { return source.lastIndexOf(object); }
/** {@inheritDoc} */ @Override public int lastIndexOf(Object object) { return source.lastIndexOf(object); }
/** {@inheritDoc} */ @Override public int lastIndexOf(Object object) { // Fast fail if the object isn't within the thresholds // Note: this technically breaks the contract for lastIndexOf. // evaluator.evaluate(object) may throw a ClassCastException if(!withinRange((E)object)) return -1; return source.lastIndexOf(object); }
/** {@inheritDoc} */ @Override public int lastIndexOf(Object object) { // Fast fail if the object isn't within the thresholds // Note: this technically breaks the contract for lastIndexOf. // evaluator.evaluate(object) may throw a ClassCastException if(!withinRange((E)object)) return -1; return source.lastIndexOf(object); }
/** {@inheritDoc} */ @Override public int lastIndexOf(Object object) { // Fast fail if the object isn't within the thresholds // Note: this technically breaks the contract for lastIndexOf. // evaluator.evaluate(object) may throw a ClassCastException if(!withinRange((E)object)) return -1; return source.lastIndexOf(object); }
/** * {@inheritDoc} */ @Override public int lastIndexOf(Object o) { return supplyInsideLock(() -> delegate.lastIndexOf(o)); }
/** {@inheritDoc} */ @Override public int lastIndexOf(Object object) { beforeReadOperation(); try { return delegate.lastIndexOf(object); } finally { afterReadOperation(); } }
/** {@inheritDoc} */ @Override public int lastIndexOf(Object object) { beforeReadOperation(); try { return delegate.lastIndexOf(object); } finally { afterReadOperation(); } }
/** {@inheritDoc} */ @Override public int lastIndexOf(Object object) { beforeReadOperation(); try { return delegate.lastIndexOf(object); } finally { afterReadOperation(); } }
/** {@inheritDoc} */ @Override public int lastIndexOf(Object object) { if(mode != SortedListWithIndexedTree.STRICT_SORT_ORDER || comparator == null) return source.lastIndexOf(object); // use the fact that we have sorted data to quickly locate a position // at which we can begin a linear search for an object that .equals(object) int index = sorted.lastIndexOf(object); // if we couldn't use the comparator to find the index, return -1 if (index == -1) return -1; // otherwise, we must now begin a linear search for the index of an element // that .equals() the given object for(; index > -1; index--) { E objectAtIndex = get(index); // if the objectAtIndex no longer compares equally with the given object, stop the linear search if(comparator.compare((E)object, objectAtIndex) != 0) return -1; // if the objectAtIndex and object are equal, return the index if(Objects.equals(object, objectAtIndex)) return index; } // if we fall out of the loop we could not locate the object return -1; }
/** {@inheritDoc} */ @Override public int lastIndexOf(Object object) { if(mode != STRICT_SORT_ORDER || comparator == null) return source.lastIndexOf(object); // use the fact that we have sorted data to quickly locate a position // at which we can begin a linear search for an object that .equals(object) int index = ((SimpleTree)sorted).indexOfValue(object, false, false, ALL_COLORS); // if we couldn't use the comparator to find the index, return -1 if (index == -1) return -1; // otherwise, we must now begin a linear search for the index of an element // that .equals() the given object for(; index > -1; index--) { E objectAtIndex = get(index); // if the objectAtIndex no longer compares equally with the given object, stop the linear search if(comparator.compare((E)object, objectAtIndex) != 0) return -1; // if the objectAtIndex and object are equal, return the index if(GlazedListsImpl.equal(object, objectAtIndex)) return index; } // if we fall out of the loop we could not locate the object return -1; }
/** {@inheritDoc} */ @Override public int lastIndexOf(Object object) { getReadWriteLock().readLock().lock(); try { return source.lastIndexOf(object); } finally { getReadWriteLock().readLock().unlock(); } }
/** * {@inheritDoc} */ @Override public int lastIndexOf(Object o) { source.getReadWriteLock().readLock().lock(); try { return source.lastIndexOf(o); } finally { source.getReadWriteLock().readLock().unlock(); } }
/** {@inheritDoc} */ @Override public int lastIndexOf(Object object) { getReadWriteLock().readLock().lock(); try { return source.lastIndexOf(object); } finally { getReadWriteLock().readLock().unlock(); } }
/** {@inheritDoc} */ @Override public int lastIndexOf(Object object) { getReadWriteLock().readLock().lock(); try { return source.lastIndexOf(object); } finally { getReadWriteLock().readLock().unlock(); } }