134 |
|
* to ensure that it can hold at least the given number of elements. |
135 |
|
* |
136 |
|
* @param minCapacity the desired minimum capacity |
137 |
+ |
* @since TBD |
138 |
|
*/ |
139 |
< |
/* TODO: public */ private void ensureCapacity(int minCapacity) { |
139 |
> |
/* public */ void ensureCapacity(int minCapacity) { |
140 |
|
if (minCapacity > elements.length) |
141 |
|
grow(minCapacity - elements.length); |
142 |
|
// checkInvariants(); |
144 |
|
|
145 |
|
/** |
146 |
|
* Minimizes the internal storage of this collection. |
147 |
+ |
* |
148 |
+ |
* @since TBD |
149 |
|
*/ |
150 |
< |
/* TODO: public */ private void trimToSize() { |
150 |
> |
/* public */ void trimToSize() { |
151 |
|
if (size < elements.length) { |
152 |
|
elements = toArray(); |
153 |
|
head = 0; |
845 |
|
* operator to that element, as specified by {@link List#replaceAll}. |
846 |
|
* |
847 |
|
* @param operator the operator to apply to each element |
848 |
+ |
* @since TBD |
849 |
|
*/ |
850 |
< |
/* TODO: public */ private void replaceAll(UnaryOperator<E> operator) { |
850 |
> |
/* public */ void replaceAll(UnaryOperator<E> operator) { |
851 |
|
Objects.requireNonNull(operator); |
852 |
|
final Object[] elements = this.elements; |
853 |
|
final int capacity = elements.length; |