Package java.util

Examples of java.util.ArrayList.ensureCapacity()


            {
                output = input.substring(k,dummyString.length());
                k = kNew;
                   
                minCapacity++;
                outputArrayList.ensureCapacity(minCapacity);
                if (outputArrayList.add(output))
                    output = new String();
                else
                    minCapacity--;
            }
View Full Code Here


    public void ensureCapacity(int capacity) {

        if (fast) {
            synchronized (this) {
                ArrayList temp = (ArrayList) list.clone();
                temp.ensureCapacity(capacity);
                list = temp;
            }
        } else {
            synchronized (list) {
                list.ensureCapacity(capacity);
View Full Code Here

  static ArrayList createArrayChildren(int start, int end, ArrayList array, FSTreeModel model) {
    ArrayList kids = new ArrayList();
    final int size = end - start;
    if (size <= ArrayNode.CUTOFF) {
      kids.ensureCapacity(size);
      for (int i = start; i < end; i++) {
        kids.add(array.get(i));
      }
    } else {
      final int deg = ArrayNode.degree(size);
View Full Code Here

    if ( reader == null ) return null;
    ArrayList result = new ArrayList();
    try {
      char[] charbuf = new char[BUFFER_SIZE];
      for ( int i = reader.read( charbuf ); i > 0 ; i = reader.read( charbuf ) ) {
        result.ensureCapacity( result.size() + BUFFER_SIZE );
        for ( int charIndex = 0; charIndex < i ; charIndex++ ) {
          result.add( Character.valueOf( charbuf[charIndex] ) );
        }
      }
    }
View Full Code Here

            List list = attributeList();

            if (list instanceof ArrayList) {
                ArrayList arrayList = (ArrayList) list;

                arrayList.ensureCapacity(minCapacity);
            }
        }
    }

    // Implementation methods
View Full Code Here

    public void ensureCapacity(int capacity) {

        if (fast) {
            synchronized (this) {
                ArrayList temp = (ArrayList) list.clone();
                temp.ensureCapacity(capacity);
                list = temp;
            }
        } else {
            synchronized (list) {
                list.ensureCapacity(capacity);
View Full Code Here

            List list = attributeList();

            if (list instanceof ArrayList) {
                ArrayList arrayList = (ArrayList) list;

                arrayList.ensureCapacity(minCapacity);
            }
        }
    }

    // Implementation methods
View Full Code Here

/*      */   public void ensureCapacity(int capacity)
/*      */   {
/*  341 */     if (this.fast) {
/*  342 */       synchronized (this) {
/*  343 */         ArrayList temp = (ArrayList)this.list.clone();
/*  344 */         temp.ensureCapacity(capacity);
/*  345 */         this.list = temp;
/*      */       }
/*      */     }
/*  348 */     synchronized (this.list) {
/*  349 */       this.list.ensureCapacity(capacity);
View Full Code Here

/* 1495 */       List list = attributeList();
/*      */
/* 1497 */       if ((list instanceof ArrayList)) {
/* 1498 */         ArrayList arrayList = (ArrayList)list;
/*      */
/* 1500 */         arrayList.ensureCapacity(minCapacity);
/*      */       }
/*      */     }
/*      */   }
/*      */
/*      */   protected Element createElement(String name)
View Full Code Here

  static ArrayList createArrayChildren(int start, int end, ArrayList array, FSTreeModel model) {
    ArrayList kids = new ArrayList();
    final int size = end - start;
    if (size <= ArrayNode.CUTOFF) {
      kids.ensureCapacity(size);
      for (int i = start; i < end; i++) {
        kids.add(array.get(i));
      }
    } else {
      final int deg = ArrayNode.degree(size);
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.