Package java.util

Examples of java.util.List.subList()


            // that

            if ((list.size() > 0)
                    && (list.get(0) instanceof LinkedHashMap)) {
                namedArgs = (Map) list.get(0);
                list = list.subList(1, list.size());
            }
            if ((list.size() > 0)
                    && (list.get(list.size() - 1) instanceof Closure)) {
                closure = (Closure) list.get(list.size() - 1);
                list = list.subList(0, list.size() - 1);
View Full Code Here


                list = list.subList(1, list.size());
            }
            if ((list.size() > 0)
                    && (list.get(list.size() - 1) instanceof Closure)) {
                closure = (Closure) list.get(list.size() - 1);
                list = list.subList(0, list.size() - 1);
            }
            Object arg;
            if (list.size() == 0) {
                arg = null;
            } else if (list.size() == 1) {
View Full Code Here

       }


       public Object[] getFullElements() {
           List l = Arrays.asList(outer.getFullElements());
           return l.subList(3, l.size() - 3).toArray();
       }


       public Object[] getOtherElements() {
           return outer.getOtherElements();
View Full Code Here

            int startIndex = serverMetadata.getFetchOffset();
            int endIndex = startIndex + serverMetadata.getFetchLimit();

            // send back just one page... query sender will figure out where it fits in
            // the incremental list
            this.response = new ListResponse(new ArrayList<Object>(cachedList.subList(
                    startIndex,
                    endIndex)));

            return DONE;
        }
View Full Code Here

            boolean del = r.nextBoolean();
            int pos = r.nextInt(result.size() + 1);
            int len = Math.min(result.size() - pos, 1 + r.nextInt(4));
            if (del && result.size() > 0)
            { // delete
                result.subList(pos, pos + len).clear();
            }
            else
            {
                for (int k = 0; k < len; k++, pos++)
                {
View Full Code Here

        // lets limit the count
        if (maximumEntryCount > 0) {
            List entries = feed.getEntries();
            int size = entries.size();
            if (size > maximumEntryCount) {
                entries.subList(maximumEntryCount, size).clear();
            }
        }
    }

    protected SyndFeed loadOrCreateFeed() throws IllegalArgumentException, FeedException, IOException {
View Full Code Here

        AutoComplete ac = (AutoComplete) component;
        List results = ac.getSuggestions();
        int maxResults = ac.getMaxResults();
       
        if(maxResults != Integer.MAX_VALUE && results.size() > maxResults) {
            results = results.subList(0, ac.getMaxResults());
        }

        encodeSuggestions(context, ac, results);
    }
View Full Code Here

                setMediakey((String) parts.get(2));
            }
        }
        else {
            // Everything after the typename is the document name, even if it contains more dividers
            String remainingParts = WGUtils.serializeCollection(parts.subList(1, parts.size()), DIVIDER);
            setName(remainingParts);
        }
       
        validate();
       
View Full Code Here

           
            // Take first and last line of code and try to parse them as XML
            String actionXML = TMLContext.ACTION_XML_PREFIX + ((String) codelines.get(0)) + ((String) codelines.get(codelines.size() - 1)) + TMLContext.ACTION_XML_SUFFIX;
            String actionCode = "";
            if (codelines.size() >= 3) {
                actionCode = WGUtils.serializeCollection(codelines.subList(1, codelines.size() -1), "\n");
            }
           
            // Parse out action flags
            boolean master = false;
            boolean async = false;
View Full Code Here

           
           
            if (!forward) {
                // If the retrieved lines includes line numbers beyond the search start line, we must remove them to prevent them from being searched (can only happen in backward mode)
                if (offset + lines.size() > searchStartLine) {
                    lines = lines.subList(0, searchStartLine - offset + 1);
                }
               
                // If not searching forward we will reverse the buffer for searching. Resulting line numbers will be calculated back.
                Collections.reverse(lines);
            }
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.