( int len )
| 94 | } |
| 95 | |
| 96 | public Ary<E> setLen( int len ) { |
| 97 | if( len > _len ) |
| 98 | while( len>= _es.length ) _es = Arrays.copyOf(_es,_es.length<<1); |
| 99 | _len = len; |
| 100 | while( _es.length > (len<<1) ) // Shrink if hugely too large |
| 101 | _es = Arrays.copyOf(_es,_es.length>>1); |
| 102 | Arrays.fill(_es,len,_es.length,null); |
| 103 | return this; |
| 104 | } |
| 105 | |
| 106 | public void swap( int i, int j ) { |
| 107 | range_check(i); |