Package java.util

Examples of java.util.ArrayList.subList()


        Date begin0 = ((KalendarEvent) arg0).getBegin();
        Date begin1 = ((KalendarEvent) arg1).getBegin();
        return begin0.compareTo(begin1);
      }
    });
    if (events.size() > MAX_EVENTS) events = events.subList(0, MAX_EVENTS);
    return events;
  }
 
  /**
   * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
View Full Code Here


        if (!indexedList)
        {
            if (list.size() > (endIdx-startIdx))
            {
                // Iterator hasn't restricted what is returned so do the index range restriction here
                return list.subList(startIdx, endIdx);
            }
        }
        return list;
    }
View Full Code Here

        }
        final Map tags2 = new HashMap();
        for(final Iterator iter = tags.keySet().iterator();iter.hasNext();) {
            final LispValue tag = (LispValue)iter.next();
            final int index = ((Integer)tags.get(tag)).intValue();
            tags2.put(tag,progns.subList(index,progns.size()));
        }

        compiler.getLegalTags().push(tags.keySet());

        final Map tags3 = new HashMap();
View Full Code Here

        parent.deleteChild(node.getValue());

        if (notify )
        {
          this.notifyRemove(path.subList(0,i).toArray(),indices,new Object[]{node});
        }

        node = parent;
        parent = node.getParent();
        i--;
View Full Code Here

    for (int i = 0; i < 10; i++) {
      al.add(new Integer(i));
    }
    assertTrue(
        "Sublist returned should have implemented Random Access interface",
        al.subList(3, 7) instanceof RandomAccess);

    List ll = new LinkedList();
    for (int i = 0; i < 10; i++) {
      ll.add(new Integer(i));
    }
View Full Code Here

     */
    public void test_subList_empty() {
        // Regression for HARMONY-389
        List al = new ArrayList();
        al.add("one");
        List emptySubList = al.subList(0, 0);

        try {
            emptySubList.get(0);
            fail("emptySubList.get(0) should throw IndexOutOfBoundsException");
        } catch (IndexOutOfBoundsException e) {
View Full Code Here

    public void test_subList_addAll() {
        // Regression for HARMONY-390
        List mainList = new ArrayList();
        Object[] mainObjects = { "a", "b", "c" };
        mainList.addAll(Arrays.asList(mainObjects));
        List subList = mainList.subList(1, 2);
        assertFalse("subList should not contain \"a\"", subList.contains("a"));
        assertFalse("subList should not contain \"c\"", subList.contains("c"));
        assertTrue("subList should contain \"b\"", subList.contains("b"));

        Object[] subObjects = { "one", "two", "three" };
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

    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

    list.add("1");
    list.add("1");
    list.add("2");
    list.add("1");
    list.add("1");
    List subList = list.subList(0, 5);

    kryo.setRegistrationRequired(false);
    kryo.register(ArrayList.class);
    Class<List> subListClass = (Class<List>)subList.getClass();
    if(subListClass.getName().equals("java.util.ArrayList$SubList")) {
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.