MCPcopy Create free account
hub / github.com/SeaOfNodes/Simple / setLen

Method setLen

chapter21/src/main/java/com/seaofnodes/simple/Ary.java:126–134  ·  view source on GitHub ↗
( int len )

Source from the content-addressed store, hash-verified

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);

Callers 1

insertMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected