Package java.util

Examples of java.util.LinkedList.listIterator()


            // Key not found: make a new key/value pair
            list = new LinkedList();
            imageCache.put(key, list);
        } else {
            // Key found: check if the image is already in the list
            for(ListIterator i = list.listIterator(0); i.hasNext(); ) {
                ImageCacheEntry entry = (ImageCacheEntry) i.next();
                if(entry.checksum == checksum && imagesMatch(entry.src, data)) {
                    href = entry.href;
                    break;
                }
View Full Code Here


        buf.append("<").append(davif.getResource()).append("> ");
    }
    ListIterator iterator = davif.getTokenListIterator();
    while (iterator.hasNext()) {
        LinkedList   list = (LinkedList) iterator.next();
        ListIterator it   = list.listIterator(0);
        buf.append("(");
        while (it.hasNext()) {
      Object token = (String) it.next();
      String item  = token.toString();
      if (it.hasNext()) {
View Full Code Here

    ListIterator it = dif.getTokenListIterator();
    while (it.hasNext()) { // OR
        boolean      checked     = true;
        boolean      not         = false;
        LinkedList   list        = (LinkedList) it.next();
        ListIterator it2         = list.listIterator(0);
        while (it2.hasNext()) { // AND
      Object tok = it2.next();
      if (tok instanceof DAVStateToken) {
          DAVStateToken dst = (DAVStateToken) tok;
          if (matchLockToken(request, dst.getStateToken())) {
View Full Code Here

     * @return the list of all arguments necessary to run the vm.
     */
    public String[] getCommandline() {
        //create the list
        List commands = new LinkedList();
        final ListIterator listIterator = commands.listIterator();
        //fill it
        addCommandsToList(listIterator);
        //convert to an array
        return (String[]) commands.toArray(new String[0]);
    }
View Full Code Here

         * @throws BuildException on error
         */
        public String[] getVariables() throws BuildException {

            List definitions = new LinkedList();
            ListIterator list = definitions.listIterator();
            addDefinitionsToList(list);
            if (definitions.size() == 0) {
                return null;
            } else {
                return (String[]) definitions.toArray(new String[0]);
View Full Code Here

                // Constructor. Note that the parent constructor runs first,
                // which means that FacesContext.currentInstance is valid
                // at the time that the RequestHandler objects run.
                {
                    log.debug("getFacesContext: running inner constructor");
                    ListIterator i = handlers.listIterator();
                    try
                    {
                        while(i.hasNext())
                        {
                            RequestHandler h = (RequestHandler) i.next();
View Full Code Here

                    // Here, run the registered RequestHandlers in reverse order.
                    // Unfortunately, there is no ReverseListIterator class, so
                    // instead here we wind an iterator forward to the end of the
                    // list before passing it to _release, which then walks
                    // backwards through the list. Ecch.
                    ListIterator i = handlers.listIterator();
                    while (i.hasNext())
                    {
                        i.next();
                    }
                    _release(i);
View Full Code Here

            // Key not found: make a new key/value pair
            list = new LinkedList();
            imageCache.put(key, list);
        } else {
            // Key found: check if the image is already in the list
            for(ListIterator i = list.listIterator(0); i.hasNext(); ) {
                ImageCacheEntry entry = (ImageCacheEntry) i.next();
                if(entry.checksum == checksum && imagesMatch(entry.src, data)) {
                    href = entry.href;
                    break;
                }
View Full Code Here

            // Key not found: make a new key/value pair
            list = new LinkedList();
            imageCache.put(key, list);
        } else {
            // Key found: check if the image is already in the list
            for(ListIterator i = list.listIterator(0); i.hasNext(); ) {
                ImageCacheEntry entry = (ImageCacheEntry) i.next();
                if(entry.checksum == checksum && imagesMatch(entry.src, data)) {
                    href = entry.href;
                    break;
                }
View Full Code Here

    myList.add(null);
    myList.add("Blah");
    myList.add(null);
    myList.add("Booga");
    myList.add(null);
    ListIterator li = myList.listIterator();
    assertTrue("li.hasPrevious() should be false", !li.hasPrevious());
    assertNull("li.next() should be null", li.next());
    assertTrue("li.hasPrevious() should be true", li.hasPrevious());
    assertNull("li.prev() should be null", li.previous());
    assertNull("li.next() should be null", li.next());
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.