Examples of ensureCapacity()


Examples of java.util.Vector.ensureCapacity()

   */
  public void test_ensureCapacityI() {
    // Test for method void java.util.Vector.ensureCapacity(int)

    Vector v = new Vector(9);
    v.ensureCapacity(20);
    assertEquals("ensureCapacity failed to set correct capacity", 20, v
        .capacity());
    v = new Vector(100);
    assertEquals("ensureCapacity reduced capacity", 100, v.capacity());
  }
View Full Code Here

Examples of javax.swing.DefaultListModel.ensureCapacity()

   */
  public void test(TestHarness harness)     
  {
    harness.checkPoint("capacity()");
    DefaultListModel m1 = new DefaultListModel();
    m1.ensureCapacity(99);
    harness.check(m1.capacity() >= 99);
  }

}
View Full Code Here

Examples of javax.swing.DefaultListModel.ensureCapacity()

   */
  public void test(TestHarness harness)     
  {
    harness.checkPoint("ensureCapacity()");
    DefaultListModel m1 = new DefaultListModel();
    m1.ensureCapacity(99);
    harness.check(m1.capacity() >= 99);
  }

}
View Full Code Here

Examples of net.algart.arrays.MutableCharArray.ensureCapacity()

            for (int count = 1; count <= 10; count++) {
                System.out.println("Iteration #" + count);
                long t1 = System.nanoTime();
                MutableCharArray cv = Arrays.SystemSettings.globalMemoryModel().newEmptyCharArray();
                if (doEnsureCapacity > 0)
                    cv.ensureCapacity(n * w.length());
                for (int k = 0; k < n; k++)
                    cv.append(w);
                long t11 = System.nanoTime();
                String s1 = Arrays.asCharSequence(cv).toString();
                long t2 = System.nanoTime();
View Full Code Here

Examples of org.apache.http.io.CharArrayBuffer.ensureCapacity()

      }
    }

    public void testEnsureCapacity() throws Exception {
        CharArrayBuffer buffer = new CharArrayBuffer(4);
        buffer.ensureCapacity(2);
        assertEquals(4, buffer.capacity());
        buffer.ensureCapacity(8);
        assertEquals(8, buffer.capacity());
    }
View Full Code Here

Examples of org.apache.http.io.CharArrayBuffer.ensureCapacity()

    public void testEnsureCapacity() throws Exception {
        CharArrayBuffer buffer = new CharArrayBuffer(4);
        buffer.ensureCapacity(2);
        assertEquals(4, buffer.capacity());
        buffer.ensureCapacity(8);
        assertEquals(8, buffer.capacity());
    }

    public void testIndexOf() {
        CharArrayBuffer buffer = new CharArrayBuffer(16);
View Full Code Here

Examples of org.apache.http.util.ByteArrayBuffer.ensureCapacity()

        }
    }

    public void testEnsureCapacity() throws Exception {
        ByteArrayBuffer buffer = new ByteArrayBuffer(4);
        buffer.ensureCapacity(2);
        assertEquals(4, buffer.capacity());
        buffer.ensureCapacity(8);
        assertEquals(8, buffer.capacity());
    }
View Full Code Here

Examples of org.apache.http.util.CharArrayBuffer.ensureCapacity()

      }
    }

    public void testEnsureCapacity() throws Exception {
        CharArrayBuffer buffer = new CharArrayBuffer(4);
        buffer.ensureCapacity(2);
        assertEquals(4, buffer.capacity());
        buffer.ensureCapacity(8);
        assertEquals(8, buffer.capacity());
    }
View Full Code Here

Examples of org.apache.http.util.CharArrayBuffer.ensureCapacity()

    public void testEnsureCapacity() throws Exception {
        CharArrayBuffer buffer = new CharArrayBuffer(4);
        buffer.ensureCapacity(2);
        assertEquals(4, buffer.capacity());
        buffer.ensureCapacity(8);
        assertEquals(8, buffer.capacity());
    }

    public void testIndexOf() {
        CharArrayBuffer buffer = new CharArrayBuffer(16);
View Full Code Here

Examples of org.apache.http.util.CharArrayBuffer.ensureCapacity()

        CharArrayBuffer result = buffer;
        final int len = estimateProtocolVersionLen(version);
        if (result == null) {
            result = new CharArrayBuffer(len);
        } else {
            result.ensureCapacity(len);
        }

        result.append(version.getProtocol());
        result.append('/');
        result.append(Integer.toString(version.getMajor()));
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.