Package java.util

Examples of java.util.List.subList()


        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


       }


       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

          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

            // 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

                assert start < end;
                assert end <= list.size();
                if (start == 0 && end == list.size()) {
                    return list;
                } else {
                    return list.subList(start, end);
                }
            }
        };
    }
}
View Full Code Here

        if(node instanceof Tag){
          final Tag t = (Tag)node;
          if(LOCAL.equals(t.getName())){
            final LocalScope scope = compileLocalScope(ctxt, t);
            return withScope(scope, compileMe(scope.getScope(),
                subnodes.subList(1, subnodes.size())), getLocation());
          }
        }
        return compileMe(ctxt, subnodes);
      }
    }
View Full Code Here

          final Tag t = (Tag)node;
          if(LOCAL.equals(t.getName())){
            final LocalScope scope = compileLocalScope(ctxt, t);
            final Dict nctxt = scope.getScope();
            return withScope(scope, compileNut(nutname, desc, nctxt,
                subnodes.subList(1, subnodes.size()), is_subnut), getLocation());
          }
        }
        return compileNut(nutname, desc, ctxt, subnodes, is_subnut);
      }
    }
View Full Code Here

            foundNames.add(u.getName());
        }
        q.closeAll();
        pm.currentTransaction().commit();
        pm.evictAll();
        assertEquals("not expected result", expectedNames.subList(0, 5), foundNames);

        pm.currentTransaction().begin();
        q = pm.newQuery(User.class);
        q.setOrdering("name ascending");
        q.setRange(2, 5);
View Full Code Here

            foundNames.add(u.getName());
        }
        q.closeAll();
        pm.currentTransaction().commit();
        pm.evictAll();
        assertEquals("not expected result", expectedNames.subList(2, 5), foundNames);

        pm.currentTransaction().begin();
        q = pm.newQuery(User.class);
        q.setOrdering("name ascending");
        c = (Collection) q.execute();
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.