MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / trim

Method trim

src/org/opensourcephysics/numerics/ArrayLib.java:482–490  ·  view source on GitHub ↗

Trims an array to be exactly the target a size. @param a the array to trim @param size the desired size of the array. This value must be lesser than or equal to the size of the input array. @return a trimmed array instance

(int[] a, int size)

Source from the content-addressed store, hash-verified

480 * @return a trimmed array instance
481 */
482 public static final int[] trim(int[] a, int size) {
483 //assert (size <= a.length);
484 if ( a.length == size ) {
485 return a;
486 }
487 int[] b = new int[size];
488 System.arraycopy(a, 0, b, 0, size);
489 return b;
490 }
491
492 /**
493 * Trims an array to be exactly the target a size.

Callers 15

getIntArrayMethod · 0.95
mediainfo.jsFile · 0.45
mainMethod · 0.45
wrapToolTipMethod · 0.45
setTargetMethod · 0.45
extract0Method · 0.45
compressListMethod · 0.45
importDataMethod · 0.45
saveMethod · 0.45
saveTabSetMethod · 0.45
setNameMethod · 0.45
setBasePathMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected