Package java.util

Examples of java.util.List.subList()


        int size = Integer.parseInt((String) tokens.get(2));
        int searchType = Integer.parseInt((String) tokens.get(3));
        boolean forward = Boolean.valueOf((String) tokens.get(4)).booleanValue();
        String searchString;
        if (tokens.size() > 6) {
            searchString = WGUtils.serializeCollection(tokens.subList(5, tokens.size() -1), ":");
        }
        else {
            searchString = (String) tokens.get(5);
        }
       
View Full Code Here


             int cnt = 0;
             for(int i=10; i< labelList.size(); i++){
                Integer tmp =(Integer) ((Map) labelList.get(i)).get("compValue");
                cnt += tmp.intValue();
             }
             labelList.subList(10, labelList.size()).clear();
             Map aMap = new HashMap();
             aMap.put("label", GuiUtil.getMessage("logAnalyzerLoggers.chart.other"));
             aMap.put("compValue", new Integer(cnt));
             labelList.add(aMap);
         }
View Full Code Here

                lastRecordExclusive = list.size();
            }

            if (startIndex < list.size())
            {
                return list.subList(startIndex, lastRecordExclusive);
            }
        }

        // use an iterator
        Iterator iterator = IteratorUtils.getIterator(iterableObject);
View Full Code Here

                        adds = add(adds, change, listChanges, value);
                        break;
                    default:
                        remove(change, listChanges, list, 0, index);
                    case 0:
                        list = list.subList(++index, list.size());
                        adds = null;
                    }
                    ++change;
                }
                remove(0, list.size(), change, listChanges, list);
View Full Code Here

                                Map nd = (Map)trail.get(0);
                                String firstTrailContentId = (String)nd.get("contentId");
                                if (UtilValidate.isNotEmpty(firstTrailContentId)
                                    && UtilValidate.isNotEmpty(lastPassedContentId)
                                    && firstTrailContentId.equals(lastPassedContentId)) {
                                    csvTrail += "," + ContentWorker.nodeTrailToCsv(trail.subList(1, trail.size()));
                                } else {
                                    csvTrail += "," + ContentWorker.nodeTrailToCsv(trail);
                                }
                            }
                        }
View Full Code Here

   *  longer in the stream.  UNTESTED!
   */
  public void rollback(String programName, int instructionIndex) {
    List is = (List)programs.get(programName);
    if ( is!=null ) {
      programs.put(programName, is.subList(MIN_TOKEN_INDEX,instructionIndex));
    }
  }

  public void deleteProgram() {
    deleteProgram(DEFAULT_PROGRAM_NAME);
View Full Code Here

            // some aren't.  In this case we create a new
            // CompositeRable with the first ones, to which we apply
            // ourselves (limiting the resolution), and after that
            // we simply draw the remainder...
            int idx = li.nextIndex()// index of first PaintRable...
            Filter f = new CompositeRable8Bit(v.subList(0, idx),
                                              comp.getCompositeRule(),
                                              comp.isColorSpaceLinear());
            f = new FilterResRable8Bit(f, getFilterResolutionX(),
                                       getFilterResolutionY());
            GraphicsUtil.drawImage(g2d, f);
View Full Code Here

    }
   
    /** Tests subList(int fromIndex, int toIndex) */      
    public void test_subList() {
        List a = defaultList();
        TestSupport.assertThat((a.subList(0, a.size()) != a),
                "subList() returned the same instance");
        TestSupport.assertEquals(a.subList(0, a.size()), a,
                "Complete subList() did not equal original List");
        TestSupport.assertThat(a.subList(0,0).size() == 0,
                "empty subList had non-zero size");
View Full Code Here

    /** Tests subList(int fromIndex, int toIndex) */      
    public void test_subList() {
        List a = defaultList();
        TestSupport.assertThat((a.subList(0, a.size()) != a),
                "subList() returned the same instance");
        TestSupport.assertEquals(a.subList(0, a.size()), a,
                "Complete subList() did not equal original List");
        TestSupport.assertThat(a.subList(0,0).size() == 0,
                "empty subList had non-zero size");
       
        try {
View Full Code Here

        List a = defaultList();
        TestSupport.assertThat((a.subList(0, a.size()) != a),
                "subList() returned the same instance");
        TestSupport.assertEquals(a.subList(0, a.size()), a,
                "Complete subList() did not equal original List");
        TestSupport.assertThat(a.subList(0,0).size() == 0,
                "empty subList had non-zero size");
       
        try {
            a.subList(-1,1);
            TestSupport.assertThat(false, "Expected IndexOutOfBoundsException");
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.