Searched defs:capacity (Results 1 - 24 of 24) sorted by relevance

/libcore/luni/src/main/java/libcore/reflect/
H A DListOfTypes.java30 ListOfTypes(int capacity) { argument
31 types = new ArrayList<Type>(capacity);
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
H A DWriterTest.java106 MockWriter(int capacity) { argument
107 contents = new char[capacity];
108 length = capacity;
/libcore/ojluni/src/main/java/java/lang/
H A DStringBuilder.java59 * Every string builder has a capacity. As long as the length of the
61 * the capacity, it is not necessary to allocate a new internal
87 * initial capacity of 16 characters.
95 * initial capacity specified by the {@code capacity} argument.
97 * @param capacity the initial capacity.
98 * @throws NegativeArraySizeException if the {@code capacity}
101 public StringBuilder(int capacity) { argument
102 super(capacity);
[all...]
H A DStringBuffer.java76 * Every string buffer has a capacity. As long as the length of the
78 * the capacity, it is not necessary to allocate a new internal
113 * initial capacity of 16 characters.
121 * the specified initial capacity.
123 * @param capacity the initial capacity.
124 * @exception NegativeArraySizeException if the {@code capacity}
127 public StringBuffer(int capacity) { argument
128 super(capacity);
133 * specified string. The initial capacity o
167 public synchronized int capacity() { method in class:StringBuffer
[all...]
H A DAbstractStringBuilder.java66 * Creates an AbstractStringBuilder of the specified capacity.
68 AbstractStringBuilder(int capacity) { argument
69 value = new char[capacity];
84 * Returns the current capacity. The capacity is the amount of storage
88 * @return the current capacity
90 public int capacity() { method in class:AbstractStringBuilder
95 * Ensures that the capacity is at least equal to the specified minimum.
96 * If the current capacity is less than the argument, then a new internal
97 * array is allocated with greater capacity
[all...]
H A DProcessEnvironment.java101 static Map<String,String> emptyEnvironment(int capacity) { argument
102 return new StringEnvironment(new HashMap<Variable,Value>(capacity));
/libcore/ojluni/src/main/java/java/nio/
H A DBuffer.java36 * buffer are its capacity, limit, and position: </p>
40 * <p> A buffer's <i>capacity</i> is the number of elements it contains. The
41 * capacity of a buffer is never negative and never changes. </p>
45 * greater than its capacity. </p>
96 * capacity values:
103 * <i>capacity</i>
115 * <p> In addition to methods for accessing the position, limit, and capacity
123 * capacity and the position to zero. </p></li>
184 // Invariants: mark <= position <= limit <= capacity
188 private int capacity; field in class:Buffer
225 public final int capacity() { method in class:Buffer
[all...]
H A DDoubleBuffer.java92 // Creates a new buffer with the given mark, position, limit, capacity,
102 // Creates a new buffer with the given mark, position, limit, and capacity
113 * capacity, its mark will be undefined, and each of its elements will be
118 * @param capacity The new buffer's capacity, in doubles
120 * @throws IllegalArgumentException If the <tt>capacity</tt> is a negative integer
122 public static DoubleBuffer allocate(int capacity) { argument
123 if (capacity < 0)
125 return new HeapDoubleBuffer(capacity, capacity);
[all...]
H A DFloatBuffer.java93 // Creates a new buffer with the given mark, position, limit, capacity,
103 // Creates a new buffer with the given mark, position, limit, and capacity
114 * capacity, its mark will be undefined, and each of its elements will be
119 * @param capacity The new buffer's capacity, in floats
121 * @throws IllegalArgumentException If the <tt>capacity</tt> is a negative integer
123 public static FloatBuffer allocate(int capacity) { argument
124 if (capacity < 0)
126 return new HeapFloatBuffer(capacity, capacity);
[all...]
H A DIntBuffer.java95 // Creates a new buffer with the given mark, position, limit, capacity,
105 // Creates a new buffer with the given mark, position, limit, and capacity
116 * capacity, its mark will be undefined, and each of its elements will be
121 * @param capacity The new buffer's capacity, in ints
123 * @throws IllegalArgumentException If the <tt>capacity</tt> is a negative integer
125 public static IntBuffer allocate(int capacity) { argument
126 if (capacity < 0)
128 return new HeapIntBuffer(capacity, capacity);
[all...]
H A DLongBuffer.java93 // Creates a new buffer with the given mark, position, limit, capacity,
103 // Creates a new buffer with the given mark, position, limit, and capacity
114 * capacity, its mark will be undefined, and each of its elements will be
119 * @param capacity The new buffer's capacity, in longs
121 * @throws IllegalArgumentException If the <tt>capacity</tt> is a negative integer
123 public static LongBuffer allocate(int capacity) { argument
124 if (capacity < 0)
126 return new HeapLongBuffer(capacity, capacity);
[all...]
H A DShortBuffer.java94 // Creates a new buffer with the given mark, position, limit, capacity,
104 // Creates a new buffer with the given mark, position, limit, and capacity
115 * capacity, its mark will be undefined, and each of its elements will be
120 * @param capacity The new buffer's capacity, in shorts
122 * @throws IllegalArgumentException If the <tt>capacity</tt> is a negative integer
124 public static ShortBuffer allocate(int capacity) { argument
125 if (capacity < 0)
127 return new HeapShortBuffer(capacity, capacity);
[all...]
H A DCharBuffer.java119 // Creates a new buffer with the given mark, position, limit, capacity,
129 // Creates a new buffer with the given mark, position, limit, and capacity
140 * capacity, its mark will be undefined, and each of its elements will be
145 * @param capacity The new buffer's capacity, in chars
147 * @throws IllegalArgumentException If the <tt>capacity</tt> is a negative integer
149 public static CharBuffer allocate(int capacity) { argument
150 if (capacity < 0)
152 return new HeapCharBuffer(capacity, capacity);
[all...]
H A DByteBuffer.java206 // Creates a new buffer with the given mark, position, limit, capacity,
216 // Creates a new buffer with the given mark, position, limit, and capacity
227 * capacity, its mark will be undefined, and each of its elements will be
231 * @param capacity The new buffer's capacity, in bytes
233 * @throws IllegalArgumentException If the <tt>capacity</tt> is a negative integer
235 public static ByteBuffer allocateDirect(int capacity) { argument
236 if (capacity < 0) {
237 throw new IllegalArgumentException("capacity < 0: " + capacity);
258 allocate(int capacity) argument
[all...]
H A DDirectByteBuffer.java58 MemoryRef(int capacity) { argument
60 buffer = (byte[]) runtime.newNonMovableArray(byte.class, capacity + 7);
86 DirectByteBuffer(int capacity, MemoryRef memoryRef) { argument
87 super(-1, 0, capacity, capacity, memoryRef.buffer, memoryRef.offset);
167 this.capacity(),
181 this.capacity(),
299 limit(capacity());
/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/
H A DCipherSpiTest.java420 public MockNonArrayBackedByteBuffer(int capacity, boolean isReadOnly) { argument
421 super(capacity, 0 /* addr */, null /* fd */, null /* unmapper */, isReadOnly);
/libcore/ojluni/src/main/java/java/util/stream/
H A DSpinedBuffer.java49 * {@link ArrayList}, as when the capacity of the list needs to be increased
90 * Constructs an empty list with the specified initial capacity.
92 * @param initialCapacity the initial capacity of the list
93 * @throws IllegalArgumentException if the specified initial capacity
103 * Constructs an empty list with an initial capacity of sixteen.
112 * Returns the current capacity of the buffer
114 protected long capacity() { method in class:SpinedBuffer
130 * Ensure that the buffer has at least capacity to hold the target size
134 long capacity = capacity();
485 protected long capacity() { method in class:SpinedBuffer.OfPrimitive
[all...]
/libcore/ojluni/src/main/java/java/util/concurrent/
H A DLinkedBlockingQueue.java66 * <p>The optional capacity bound constructor argument serves as a
67 * way to prevent excessive queue expansion. The capacity, if unspecified,
70 * queue above capacity.
136 /** The capacity bound, or Integer.MAX_VALUE if none */
137 private final int capacity; field in class:LinkedBlockingQueue
246 * Creates a {@code LinkedBlockingQueue} with a capacity of
254 * Creates a {@code LinkedBlockingQueue} with the given (fixed) capacity.
256 * @param capacity the capacity of this queue
257 * @throws IllegalArgumentException if {@code capacity} i
260 LinkedBlockingQueue(int capacity) argument
[all...]
H A DArrayBlockingQueue.java65 * extracted by consumers. Once created, the capacity cannot be
219 * capacity and default access policy.
221 * @param capacity the capacity of this queue
222 * @throws IllegalArgumentException if {@code capacity < 1}
224 public ArrayBlockingQueue(int capacity) { argument
225 this(capacity, false);
230 * capacity and the specified access policy.
232 * @param capacity the capacity o
238 ArrayBlockingQueue(int capacity, boolean fair) argument
263 ArrayBlockingQueue(int capacity, boolean fair, Collection<? extends E> c) argument
[all...]
H A DLinkedBlockingDeque.java56 * <p>The optional capacity bound constructor argument serves as a
57 * way to prevent excessive expansion. The capacity, if unspecified,
60 * deque above capacity.
155 private final int capacity; field in class:LinkedBlockingDeque
167 * Creates a {@code LinkedBlockingDeque} with a capacity of
175 * Creates a {@code LinkedBlockingDeque} with the given (fixed) capacity.
177 * @param capacity the capacity of this deque
178 * @throws IllegalArgumentException if {@code capacity} is less than 1
180 public LinkedBlockingDeque(int capacity) { argument
[all...]
/libcore/ojluni/src/main/java/java/util/
H A DIdentityHashMap.java143 * The initial capacity used by the no-args constructor.
151 * The minimum capacity, used if a lower value is implicitly specified
159 * The maximum capacity, used if a higher value is implicitly specified
226 init(capacity(expectedMaxSize));
230 * Returns the appropriate capacity for the given expected maximum size.
236 private static int capacity(int expectedMaxSize) { method in class:IdentityHashMap
246 * capacity, which is assumed to be a power of two between
439 // Next capacity is len, 2 * current capacity.
452 * Resizes the table if necessary to hold given capacity
[all...]
H A DVector.java40 * {@code capacity} and a {@code capacityIncrement}. The
41 * {@code capacity} is always at least as large as the vector
45 * capacity of a vector before inserting a large number of
89 * stored. The capacity of the vector is the length of this array buffer,
108 * The amount by which the capacity of the vector is automatically
109 * incremented when its size becomes greater than its capacity. If
110 * the capacity increment is less than or equal to zero, the capacity
121 * Constructs an empty vector with the specified initial capacity and
122 * capacity incremen
305 public synchronized int capacity() { method in class:Vector
[all...]
H A DHashMap.java50 * collection views requires time proportional to the "capacity" of the
53 * capacity too high (or the load factor too low) if iteration performance is
57 * performance: <i>initial capacity</i> and <i>load factor</i>. The
58 * <i>capacity</i> is the number of buckets in the hash table, and the initial
59 * capacity is simply the capacity at the time the hash table is created. The
61 * get before its capacity is automatically increased. When the number of
63 * current capacity, the hash table is <i>rehashed</i> (that is, internal data
73 * setting its initial capacity, so as to minimize the number of
74 * rehash operations. If the initial capacity i
1342 final int capacity() { method in class:HashMap
[all...]
/libcore/luni/src/main/native/
H A Dorg_apache_harmony_xml_ExpatParser.cpp66 StringStack() : array(new jstring[DEFAULT_CAPACITY]), capacity(DEFAULT_CAPACITY), size(0) {
74 if (size == capacity) {
75 int newCapacity = capacity * 2;
81 memcpy(newArray, array, capacity * sizeof(jstring));
85 capacity = newCapacity;
99 int capacity; member in class:StringStack

Completed in 811 milliseconds