Package java.util

Examples of java.util.List.subList()


      {
        retval.add("..");
      }
    }

    retval.addAll(urlName.subList(commonIndex, urlName.size()));
    return formatName(retval, null);
  }

  /**
   * Creates a relative url by stripping the common parts of the the url.
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

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

        }

  /**
     * @tests java.util.AbstractList#subList(int, int)
View Full Code Here

            // We start at an offset of 1 because the entire column
            // list is generally implicitly indexed by the fact that
            // it's a primary key.
            for (int i = 1; i < size; i++)
            {
                addIndex(new Index(this, pk.subList(i, size)));
            }
        }
        catch (EngineException e)
        {
            log.error(e, e);
View Full Code Here

  public static void save(IDialogSettings settings, String key, Combo combo) {
    List history = new ArrayList(Arrays.asList(combo.getItems()));
    history.remove(combo.getText());
    history.add(0, combo.getText());
    if (history.size() > HISTORY_LIMIT) {
      history = history.subList(0, HISTORY_LIMIT);
    }
    settings.put(key, (String[]) history.toArray(new String[0]));
  }

}
View Full Code Here

    List luceneSubQueries = makeLuceneSubQueriesField(fieldName, qf);
    BooleanQuery bq = new BooleanQuery();
    bq.add( (Query) luceneSubQueries.get(0), BooleanClause.Occur.MUST);
    SrndBooleanQuery.addQueriesToBoolean(bq,
            // FIXME: do not allow weights on prohibited subqueries.
            luceneSubQueries.subList(1, luceneSubQueries.size()),
            // later subqueries: not required, prohibited
            BooleanClause.Occur.MUST_NOT);
    return bq;
  }
}
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

       }


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


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

      fileList = Arrays.asList(new File(args[2]).list());
    } else {
      // it's going to be a list of files anyways
      // so just treat the whole argList as a list of file names
      List argList = Arrays.asList(args);
      fileList = argList.subList(2, argList.size());
    }

    PCSLongLister lister = new PCSLongLister(args[0], args[1]);
    lister.doList(fileList);
View Full Code Here

                boolean bSomethingAdded = false;
                if (prevLM != this) {
                    //log.debug(" BLM.getChangedKnuthElements> chiamata da "
                    //    + fromIndex + " a " + workListIterator.previousIndex() + " su "
                    //    + prevLM.getClass().getName());
                    returnedList.addAll(prevLM.getChangedKnuthElements(workList.subList(
                                fromIndex, workListIterator.previousIndex()), alignment));
                    bSomethingAdded = true;
                } else {
                    // prevLM == this
                    // do nothing
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.