Examples of sublist()


Examples of java.util.List.subList()

    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

Examples of java.util.List.subList()

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

Examples of java.util.List.subList()

  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

Examples of java.util.List.subList()

  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

Examples of java.util.List.subList()

    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

Examples of java.util.List.subList()

        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

Examples of java.util.List.subList()

        idx    = -(idx + 1);
      } else {
        idx    = getLeftMostIndex( collResult, idx, false );
      }
//long t6 = System.currentTimeMillis();
      collResult  = collResult.subList( idx, collResult.size() );
//long t7 = System.currentTimeMillis();
//System.out.println( "editGetRange " + (t2-t1) + " / " + (t3-t2) + " / " + (t4-t3) + " / " + (t5-t4) + " / " + (t6-t5) + " / " + (t7-t6) );
    }

    return collResult;
View Full Code Here

Examples of java.util.List.subList()

  }

  public List getAll( int startIdx, int stopIdx, boolean byStart )
  {
    final List coll = byStart ? collStakesByStart : collStakesByStop;
    return new ArrayList( coll.subList( startIdx, stopIdx ));
  }
 
  public void add( Object source, Stake stake )
  throws IOException
  {
View Full Code Here

Examples of java.util.List.subList()

            int startIndex = serverMetadata.getFetchStartIndex();
            int endIndex = startIndex + serverMetadata.getFetchLimit();

            // send back just one page... query sender will figure out where it fits in
            // the incremental list
            this.response = new ListResponse(new ArrayList<Object>(cachedList.subList(
                    startIndex,
                    endIndex)));

            return DONE;
        }
View Full Code Here

Examples of java.util.List.subList()

         Collections.sort(uf, new UserEntryComparator());

         if (offset + limit <= size)
         {
            return processUsers(uf.subList(offset, offset + limit));
         }
         else if (offset >= size)
         {
            return new HashSet();
         }
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.