Package java.util

Examples of java.util.ArrayList.subList()


        if (args != null && args.length > 0) {
            ArrayList<String> argList = new ArrayList(Arrays.asList(args));
            int pos = argList.indexOf("-p4");
            if (pos != -1) {
                List<String> p4CmdLine = new ArrayList<String>();
                p4CmdLine.addAll(argList.subList(pos+1, argList.size()));
                argList.subList(pos, argList.size()).clear();

                String firstArg = p4CmdLine.get(0);
                File firstArgFile = new File(firstArg);
                if (!(firstArg.toLowerCase().contains("p4")
View Full Code Here


            ArrayList<String> argList = new ArrayList(Arrays.asList(args));
            int pos = argList.indexOf("-p4");
            if (pos != -1) {
                List<String> p4CmdLine = new ArrayList<String>();
                p4CmdLine.addAll(argList.subList(pos+1, argList.size()));
                argList.subList(pos, argList.size()).clear();

                String firstArg = p4CmdLine.get(0);
                File firstArgFile = new File(firstArg);
                if (!(firstArg.toLowerCase().contains("p4")
                        && firstArgFile.isFile()))
View Full Code Here

        while (!doomedIds.isEmpty()) {
            int size = doomedIds.size();
            int end = (batchSize < size) ? batchSize : size;

            List<Integer> idBatch = doomedIds.subList(0, end);
            query.setParameter("ids", idBatch);
            query.executeUpdate();

            // Advance our progress and possibly help GC. This will remove the processed ids from the backing list
            idBatch.clear();
View Full Code Here

        Collections.shuffle(bel, new Random(53672));
        assertEquals(replay, bel);

        List s = new ArrayList(bel);
        Collections.shuffle(s);
        s = s.subList(10, 90);
        bel.retainAll(s);
        assertEquals(replay, bel);

        s = new ArrayList(bel);
        Collections.shuffle(s);
View Full Code Here

        bel.retainAll(s);
        assertEquals(replay, bel);

        s = new ArrayList(bel);
        Collections.shuffle(s);
        s = s.subList(10, 20);
        bel.removeAll(s);
        assertEquals(replay, bel);
    }
}
View Full Code Here

          sublist.add(entries[j]);
        }
      }
      Collections.sort(sublist);
      if (sublist.size() > MAX_SIZE) {
        sublist = sublist.subList(0, MAX_SIZE);
      }
      list.addAll(sublist);
      sublist.clear();
    }
    for (int i=0; i<list.size(); i++) {
View Full Code Here

            if( beg >= count.intValue()) return new Object[] { count, new ArrayList() }; // Return an empty array if start is beyond end.
            int end = beg + numrecords.intValue();
            if( beg < 0 || end < beg ) return new Object[] { count, hist }; // Return entire array if either start or numrecords is less than 0.
            if( end > count.intValue() ) end = count.intValue();

            return new Object[] { count, hist.subList( beg, end ) };

        } catch( NullPointerException e ) {

            return new Object[] { count, hist };
View Full Code Here

        new Support_ListTest("", alist).runTest();

        ArrayList subList = new ArrayList();
        for (int i = -50; i < 150; i++)
            subList.add(new Integer(i));
        new Support_ListTest("", subList.subList(50, 150)).runTest();
    }

    /**
     * @tests java.util.ArrayList#ArrayList(int)
     */
 
View Full Code Here

          sublist.add(entries[j]);
        }
      }
      Collections.sort(sublist);
      if (sublist.size() > MAX_SIZE) {
        sublist = sublist.subList(0, MAX_SIZE);
      }
      list.addAll(sublist);
      sublist.clear();
    }
    for (int i=0; i<list.size(); i++) {
View Full Code Here

        // sort the hits
        Collections.sort(mdhList, iv_mdhComparator);

        // truncate off the hits
        mdhList.subList(iv_mdhCount, mdhList.size()).clear();
       
        return mdhList;
    }
}
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.