Package java.util

Examples of java.util.List.subList()


        //now the order by should only contain element symbols
    } catch (TeiidException err) {
            throw new TeiidRuntimeException(err);
        }
    List symbols = top.getSelect().getSymbols();
    top.getSelect().setSymbols(symbols.subList(0, originalSymbolCount));
    top.setInto(into);
    top.setLimit(limit);
    top.setOrderBy(orderBy);
    return top;
    }
View Full Code Here


        fromIdx = 0;
      int toIdx = fromIdx + sform.getNumResults();
      if(toIdx > results.size())
        toIdx = results.size();
     
      request.setAttribute("results", results.subList(fromIdx, toIdx));
      request.setAttribute("time", Long.toString(lTime));
    }
    request.setAttribute("param", sform);

    return mapping.getInputForward();
View Full Code Here

    // Add key metadata
    FakeMetadataObject pm1g1key1 = createKey("pm1.g1.key1", pm1g1, pm1g1e.subList(0, 1)); //e1 //$NON-NLS-1$
    FakeMetadataObject pm3g1key1 = createKey("pm3.g1.key1", pm3g1, pm3g1e.subList(0, 1)); //e1 //$NON-NLS-1$
    FakeMetadataObject pm3g3key1 = createKey("pm3.g3.key1", pm3g3, pm3g3e.subList(0, 1)); //e1 //$NON-NLS-1$
        FakeMetadataObject pm4g1key1 = createKey("pm4.g1.key1", pm4g1, pm4g1e.subList(0, 2)); //e1, e2 //$NON-NLS-1$
        FakeMetadataObject pm4g2key1 = createForeignKey("pm4.g2.fk", pm4g2, pm4g2e.subList(0, 2), pm4g1key1); //$NON-NLS-1$
    // Add access pattern metadata
    // Create access patterns - pm1
    List elements = new ArrayList(1);
    elements.add(pm1g1e.iterator().next());      
    FakeMetadataObject pm1g1ap1 = createAccessPattern("pm1.g1.ap1", pm1g1, elements); //e1 //$NON-NLS-1$
View Full Code Here

      {
         lock.readLock().lock();
         try
         {
            List state = getCurrentState(false);
            return state.subList(fromIndex, toIndex);
         }
         finally
         {
            lock.readLock().unlock();
         }
View Full Code Here

    if (AJ_DEBUG) System.out.println(o);
  }

  private void printStack(Object[] s, int p) {
    List list = Arrays.asList(s);
    System.out.println("  " + list.subList(0, p+1));
  }
 
  private void printStack(int[] s, int p) {
    StringBuffer buf = new StringBuffer("[");
    for (int i=0; i<p+1; i++) {
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 Object obtain(Object collection, Integer from, Integer to) {
    if (collection instanceof List) {
      List list = (List) collection;

      return list.subList(from, to + 1);
    } else if (collection instanceof String) {
      String string = (String) collection;

      return string.substring(from, to + 1);
    } else if (collection instanceof Object[]) {
View Full Code Here

  public static Object sliceFrom(Object collection, Object fromObj) {
    int from = (Integer)fromObj;
    if (collection instanceof List) {
      List list = (List) collection;

      return list.subList(from, list.size());
    } else if (collection instanceof String) {
      String string = (String) collection;

      return string.substring(from, string.length());
    } else if (collection instanceof Object[]) {
View Full Code Here

    int to = (Integer)toObj;

    if (collection instanceof List) {
      List list = (List) collection;

      return list.subList(0, to + 1);
    } else if (collection instanceof String) {
      String string = (String) collection;

      return string.substring(0, to + 1);
    } else if (collection instanceof Object[]) {
View Full Code Here

        idx    = -(idx + 1);
      } else {
        idx    = getRightMostIndex( collResult, idx, true ) + 1;
      }
//  long t6 = System.currentTimeMillis();
      collResult  = collResult.subList( 0, idx );
//  long t7 = System.currentTimeMillis();
//  System.out.println( "editGetRange " + (t2-t1) + " / " + (t3-t2) + " / " + (t4-t3) + " / " + (t5-t4) + " / " + (t6-t5) + " / " + (t7-t6) );
 
    } else {
      idx      = Collections.binarySearch( collByStart, new Long( span.stop ), startComparator );
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.