Package java.util

Examples of java.util.LinkedList.removeLast()


        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


                if (last.denotesRoot()) {
                    // the first element is the root element;
                    // ".." would refer to the parent of root
                    throw new MalformedPathException("Path can not be canonicalized: unresolvable '..' element");
                }
                queue.removeLast();
                if (queue.isEmpty()) {
                    last = null;
                } else {
                    last = (PathElement) queue.getLast();
                }
View Full Code Here

    public Object pop() {
        LinkedList list = listThreadLocal.getList();
        if (list.isEmpty()) {
            return null;
        }
        return list.removeLast();
    }

    public void clear() {
        listThreadLocal.getList().clear();
    }
View Full Code Here

            }
            LinkedList classQueue = new LinkedList();
            classQueue.addFirst(rootArgumentType);

            while (!classQueue.isEmpty()) {
                Class argumentType = (Class) classQueue.removeLast();
                // Check for a visit method on the visitor class matching this
                // argument type.
                try {
                    if (logger.isTraceEnabled()) {
                        logger.trace("Looking for method " + VISIT_METHOD + "(" + argumentType + ")");
View Full Code Here

                    insertPrefNamePstmt.setString(3, chanDescId);
                    insertPrefNamePstmt.setString(4, pref.getName());
                   
                    //Use the list of removed ids to re-use IDs before generating new ones
                    if (prefIds.size() > 0) {
                        prefId = ((Integer)prefIds.removeLast()).intValue();
                    }
                    else {
                        final ICounterStore counterStore = CounterStoreFactory.getCounterStoreImpl();
                       
                        try {
View Full Code Here

                        insertPrefNamePstmt.setString(3, READ_ONLY_FALSE);
                    }
                   
                    //Use the list of removed ids to re-use IDs before generating new ones
                    if (prefIds.size() > 0) {
                        prefId = ((Integer)prefIds.removeLast()).intValue();
                    } else {
                        final ICounterStore counterStore = CounterStoreFactory.getCounterStoreImpl();
                        prefId = counterStore.getIncrementIntegerId(UP_PORTLET_PREFERENCE_VALUE);
                    }
                   
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

        }
        // 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

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.