( int len )
| 109 | } |
| 110 | |
| 111 | public Ary<E> setLen( int len ) { |
| 112 | if( len > _len ) |
| 113 | while( len>= _es.length ) _es = Arrays.copyOf(_es,_es.length<<1); |
| 114 | _len = len; |
| 115 | while( _es.length > (len<<1) ) // Shrink if hugely too large |
| 116 | _es = Arrays.copyOf(_es,_es.length>>1); |
| 117 | Arrays.fill(_es,len,_es.length,null); |
| 118 | return this; |
| 119 | } |
| 120 | |
| 121 | public E swap( int i, int j ) { |
| 122 | range_check(i); |