Examples of trimToSize()


Examples of edu.umd.cloud9.io.array.ArrayListOfIntsWritable.trimToSize()

        //System.out.println("-->" + curr + " " + links.toString());
        if (!(stopList.contains(curr))) {
          if (adjLists.containsKey(curr)) {
            //FIXME?
            ArrayListOfIntsWritable list = new ArrayListOfIntsWritable(adjLists.get(curr));
            list.trimToSize();
            links.trimToSize();
            list.addUnique(links.getArray());
            adjLists.remove(curr);
            adjLists.put(curr, list);
          } else {
View Full Code Here

Examples of edu.umd.cloud9.util.array.ArrayListOfDoubles.trimToSize()

    }

    double[] rawArray = list.getArray();
    int lenBefore = rawArray.length;

    list.trimToSize();
    double[] rawArrayAfter = list.getArray();
    int lenAfter = rawArrayAfter.length;

    assertEquals(89, lenAfter);
    assertTrue(lenBefore > lenAfter);
View Full Code Here

Examples of edu.umd.cloud9.util.array.ArrayListOfFloats.trimToSize()

    }

    float[] rawArray = list.getArray();
    int lenBefore = rawArray.length;

    list.trimToSize();
    float[] rawArrayAfter = list.getArray();
    int lenAfter = rawArrayAfter.length;

    assertEquals(89, lenAfter);
    assertTrue(lenBefore > lenAfter);
View Full Code Here

Examples of edu.umd.cloud9.util.array.ArrayListOfInts.trimToSize()

        LOG.warn("Error: tf of " + e.getValue()
            + " will overflow max short value. docno=" + doc.getDocid() + ", term="
            + e.getKey());
        it.remove();
      } else {
        positionsList.trimToSize();
        doclength += positionsList.size();
      }
    }

    if ( positions.size() == 0 ) {
View Full Code Here

Examples of edu.umd.cloud9.util.array.ArrayListOfShorts.trimToSize()

    }

    short[] rawArray = list.getArray();
    int lenBefore = rawArray.length;

    list.trimToSize();
    short[] rawArrayAfter = list.getArray();
    int lenAfter = rawArrayAfter.length;

    assertEquals(89, lenAfter);
    assertTrue(lenBefore > lenAfter);
View Full Code Here

Examples of gnu.trove.TIntArrayList.trimToSize()

/*     */     {
/* 133 */       TIntArrayList list = new TIntArrayList();
/* 134 */       for (int i = 0; i < 1000; i++) {
/* 135 */         list.add(i);
/*     */       }
/* 137 */       list.trimToSize();
/* 138 */       return list;
/*     */     }
/*     */   }
/*     */
/*     */   static abstract interface Creator
View Full Code Here

Examples of java.util.ArrayList.trimToSize()

        while ((tempElement = decodeInputStream(dbis, nesting+1, internKeys)) != null) {
            //add the element
          tempList.add(tempElement);
        }

        tempList.trimToSize();
        dbis.mark(Integer.MAX_VALUE);
        tempByte = dbis.read();
        dbis.reset();
        if ( nesting > 0 && tempByte == -1 ){
View Full Code Here

Examples of java.util.ArrayList.trimToSize()

        while (it.hasNext()) {
            Object o = it.next();
            if (set.add(o))
                ulist.add(o);
        }
        ulist.trimToSize();
        return ulist;
    }

    private static final Map createOperations()
    {
View Full Code Here

Examples of java.util.ArrayList.trimToSize()

    public SimpleSequence(TemplateCollectionModel tcm) throws TemplateModelException {
        ArrayList alist = new ArrayList();
        for (TemplateModelIterator it = tcm.iterator(); it.hasNext();) {
            alist.add(it.next());
        }
        alist.trimToSize();
        list = alist;
    }

    /**
     * Constructs an empty simple sequence using the specified object wrapper.
View Full Code Here

Examples of java.util.ArrayList.trimToSize()

  IJavaElement parent = element.getParent();
  while (parent != null) {
    parents.add(parent);
    parent = parent.getParent();
  }
  parents.trimToSize();
  return parents;
}
/**
* @see IRegion
*/
 
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.