Package java.util

Examples of java.util.LinkedList.removeLast()


      return findTargetConverter(objectConverters, targetClass);
    } else {
      LinkedList classQueue = new LinkedList();
      classQueue.addFirst(sourceClass);
      while (!classQueue.isEmpty()) {
        Class currentClass = (Class) classQueue.removeLast();
        Map sourceTargetConverters = findConvertersForSource(currentClass);
        Converter converter = findTargetConverter(sourceTargetConverters, targetClass);
        if (converter != null) {
          return converter;
        }
View Full Code Here


    }
    if (targetClass.isInterface()) {
      LinkedList classQueue = new LinkedList();
      classQueue.addFirst(targetClass);
      while (!classQueue.isEmpty()) {
        Class currentClass = (Class) classQueue.removeLast();
        Converter converter = (Converter) sourceTargetConverters.get(currentClass);
        if (converter != null) {
          return converter;
        }
        Class[] interfaces = currentClass.getInterfaces();
View Full Code Here

      return (Converter) sourceTargetConverters.get(Object.class);
    } else {
      LinkedList classQueue = new LinkedList();
      classQueue.addFirst(targetClass);
      while (!classQueue.isEmpty()) {
        Class currentClass = (Class) classQueue.removeLast();
        Converter converter = (Converter) sourceTargetConverters.get(currentClass);
        if (converter != null) {
          return converter;
        }
        if (currentClass.getSuperclass() != null) {
View Full Code Here

        }
        // Add the new file at the start of the list
        newRecentFiles.add(0, loadedFileName);
        // Remove the last item from the list if it was a brand new file
        if(!alreadyExists) {
            newRecentFiles.removeLast();
        }
        // Store the recent files
        for(int i = 0; i < NUMBER_OF_MENU_ITEMS; i++) {
            String fileName = (String)newRecentFiles.get(i);
            if(fileName != null) {
View Full Code Here

        for(int x = loopCount; x > 0; x--) {
            // unrolled a few times to minimize effect of loop
            ll.addFirst(o1);
            ll.addLast(o2);
            ll.removeFirst();
            ll.removeLast();
            ll.add(o1);
            ll.remove(0);
            //
            ll.addFirst(o1);
            ll.addLast(o2);
View Full Code Here

            ll.remove(0);
            //
            ll.addFirst(o1);
            ll.addLast(o2);
            ll.removeFirst();
            ll.removeLast();
            ll.add(o1);
            ll.remove(0);
            //
            ll.addFirst(o1);
            ll.addLast(o2);
View Full Code Here

            ll.remove(0);
            //
            ll.addFirst(o1);
            ll.addLast(o2);
            ll.removeFirst();
            ll.removeLast();
            ll.add(o1);
            ll.remove(0);
        }
        endTime = System.currentTimeMillis();  
        System.out.println("Time with LinkedList: " + (endTime - startTime) + " ms");
View Full Code Here

        LinkedList clean = new LinkedList();
        while (st.hasMoreTokens()) {
            String token = st.nextToken();
            if ("..".equals(token)) {
                if (! clean.isEmpty() && ! "..".equals(clean.getLast())) {
                    clean.removeLast();
                    if (! st.hasMoreTokens()) {
                        isDir = true;
                    }
                } else {
                    clean.add("..");
View Full Code Here

    //  no change, stays with no styling
    // If there is styling:
    //  everthing gets the same style that the first block has
    if(_styleAtom != null) {
      LinkedList pStyles = _styleAtom.getParagraphStyles();
      while(pStyles.size() > 1) { pStyles.removeLast(); }
     
      LinkedList cStyles = _styleAtom.getCharacterStyles();
      while(cStyles.size() > 1) { cStyles.removeLast(); }
     
      _rtRuns[0].setText(s);
View Full Code Here

    if(_styleAtom != null) {
      LinkedList pStyles = _styleAtom.getParagraphStyles();
      while(pStyles.size() > 1) { pStyles.removeLast(); }
     
      LinkedList cStyles = _styleAtom.getCharacterStyles();
      while(cStyles.size() > 1) { cStyles.removeLast(); }
     
      _rtRuns[0].setText(s);
    } else {
      // Recreate rich text run with no styling
      _rtRuns[0] = new RichTextRun(this,0,s.length());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.