Package java.util

Examples of java.util.ArrayList.trimToSize()


/*      */   public void trimToSize()
/*      */   {
/*  785 */     if (this.fast) {
/*  786 */       synchronized (this) {
/*  787 */         ArrayList temp = (ArrayList)this.list.clone();
/*  788 */         temp.trimToSize();
/*  789 */         this.list = temp;
/*      */       }
/*      */     }
/*  792 */     synchronized (this.list) {
/*  793 */       this.list.trimToSize();
View Full Code Here


/* 144 */       ArrayList list = new ArrayList();
/* 145 */       for (int i = 0; i < 1000; i++) {
/* 146 */         Integer x = new Integer(i);
/* 147 */         list.add(x);
/*     */       }
/* 149 */       list.trimToSize();
/* 150 */       return list;
/*     */     }
/*     */   }
/*     */
/*     */   static class TroveIntArrayListCreator
View Full Code Here

        ArrayList al = new ArrayList();
        StringTokenizer st = new StringTokenizer(cp, pathSep);
        while (st.hasMoreTokens()) {
            al.add(st.nextToken());
        }
        al.trimToSize();
        return al;
    }

    public List classPath() {
        return getPath("java.class.path");
View Full Code Here

        public void trimToSize() {
            super.trimToSize();
            for (int isM = 0; isM <= 1; isM++) {
                ArrayList members = (isM == 0) ? fields : methods;
                if (members == nullcontinue;
                members.trimToSize();
                for (Iterator i = members.iterator(); i.hasNext(); ) {
                    Member m = (Member)i.next();
                    m.trimToSize();
                }
            }
View Full Code Here

             Element element = getQuiet(key);
             if (element != null) {
                 nonExpiredKeys.add(key);
             }
         }
         nonExpiredKeys.trimToSize();
         return nonExpiredKeys;
    }


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