( int len )
| 124 | } |
| 125 | |
| 126 | public Ary<E> setLen( int len ) { |
| 127 | if( len > _len ) |
| 128 | while( len>= _es.length ) _es = Arrays.copyOf(_es,_es.length<<1); |
| 129 | _len = len; |
| 130 | while( _es.length > (len<<1) ) // Shrink if hugely too large |
| 131 | _es = Arrays.copyOf(_es,_es.length>>1); |
| 132 | Arrays.fill(_es,len,_es.length,null); |
| 133 | return this; |
| 134 | } |
| 135 | |
| 136 | public E swap( int i, int j ) { |
| 137 | range_check(i); |