@Override public int lastIndexOf(Object o) { return pipeList.lastIndexOf(o); }
public void test4NoBugs(LinkedList<? super CharSequence> list) { list.lastIndexOf(new StringBuffer("Key")); }
public void test4Bugs(LinkedList<? super CharSequence> list) { list.lastIndexOf(Integer.valueOf(3)); }
/** * This method will be called when an edge leading to given vertex was added and we want to check if introduction of * this edge has not resulted in apparition of cycle in the graph * * @param vertex * @param vertexStateMap * @return */ public static List<String> introducesCycle( final Vertex vertex, final Map<Vertex, Integer> vertexStateMap ) { final LinkedList<String> cycleStack = new LinkedList<String>(); final boolean hasCycle = dfsVisit( vertex, cycleStack, vertexStateMap ); if ( hasCycle ) { // we have a situation like: [b, a, c, d, b, f, g, h]. // Label of Vertex which introduced the cycle is at the first position in the list // We have to find second occurrence of this label and use its position in the list // for getting the sublist of vertex labels of cycle participants // // So in our case we are searching for [b, a, c, d, b] final String label = cycleStack.getFirst(); final int pos = cycleStack.lastIndexOf( label ); final List<String> cycle = cycleStack.subList( 0, pos + 1 ); Collections.reverse( cycle ); return cycle; } return null; }
waitingThreadList.lastIndexOf( lockRequest ) );
if (sync.waitingThreads.contains(thread.getId())) { val.setChanged(nodes.lastIndexOf(thisNode) == 0);
@Override public int lastIndexOf(Object o) { return list.lastIndexOf(o); }
@Override public int lastIndexOf(Object o) { return pipeList.lastIndexOf(o); }
/** * @see List#lastIndexOf(Object) */ @Override public int lastIndexOf(Object o) { return this.processors.lastIndexOf(o); }
@Override public int lastIndexOf(Object o) { synchronized (this) { return super.lastIndexOf(o); //To change body of generated methods, choose Tools | Templates. } }
/** * @see List#lastIndexOf(Object) */ @Override public int lastIndexOf(Object o) { return this.processors.lastIndexOf(o); }
@Override public int lastIndexOf(Object o) { try { lock.readLock().lock(); return super.lastIndexOf(o); } finally { lock.readLock().unlock(); } }
import java.util.*; public class Main { public static void main(String[] args) { LinkedList l1=new LinkedList(); for (int i=100;i<=600;i+=100) { l1.add(String.valueOf(i)); } System.out.println(l1); System.out.println(l1.indexOf("200")); System.out.println(l1.lastIndexOf("200")); } }
private void replaceInQueue(LinkedList<Element> queue, Element out, Element in) { int i = queue.lastIndexOf(out); Validate.isTrue(i != -1); queue.remove(i); queue.add(i, in); }
private void replaceInQueue(LinkedList<Element> queue, Element out, Element in) { int i = queue.lastIndexOf(out); Validate.isTrue(i != -1); queue.remove(i); queue.add(i, in); }
private void replaceInQueue(LinkedList<Element> queue, Element out, Element in) { int i = queue.lastIndexOf(out); Validate.isTrue(i != -1); queue.remove(i); queue.add(i, in); }
@Override public int lastIndexOf(Object o) { if (!_directAccess && isDelayLoad()) { load(); } return super.lastIndexOf(o); }
@Override public int lastIndexOf(Object o) { if (!_directAccess && isDelayLoad()) { load(); } return super.lastIndexOf(o); }
@Override public int lastIndexOf(Object o) { if (!_directAccess && isDelayLoad()) { load(); } return super.lastIndexOf(o); }
@Override public int lastIndexOf(Object o) { if (!_directAccess && isDelayLoad()) { load(); } return super.lastIndexOf(o); }