( int len )
| 120 | } |
| 121 | |
| 122 | public Ary<E> setLen( int len ) { |
| 123 | if( len > _len ) |
| 124 | while( len>= _es.length ) _es = Arrays.copyOf(_es,_es.length<<1); |
| 125 | _len = len; |
| 126 | while( _es.length > (len<<1) ) // Shrink if hugely too large |
| 127 | _es = Arrays.copyOf(_es,_es.length>>1); |
| 128 | Arrays.fill(_es,len,_es.length,null); |
| 129 | return this; |
| 130 | } |
| 131 | |
| 132 | /** @param c Collection to be added */ |
| 133 | public boolean addAll( Collection<? extends E> c ) { |