Arrays - roidrole/Roids-Tweaker GitHub Wiki
Provides array utilities.
Importing class
import mods.ctintegration.util.ArrayUtil;
Methods in this class support any type internally convertible to IData. This means :
- int
- double
- float
- string
- short
- byte
- long
- DataAnything
- Anything you convert to IData
Methods
| Method | Parameters | Description |
|---|---|---|
| sort | array as IData[] | Sorts this array in ascending order. This method is the only one not working with DataAnything |
| reverse | array as IData[] | Reverses the order of this array. |
| fill | array as IData[], element as IData | Replaces all elements of this array with the specified element |
| merge | array1 as IData[], array2 as IData[] | Returns a new IData[] containing the elements of both array |
| trim | array as IData[], begin as int, end as int | Returns a new IData[] whose elements start at the index specified at begin and end before the stop index |
| toString | array as IData[] | Returns a string representing this array. |
| createArray | element as IData, amount as int | Returns a new IData[] containing amount copies of element |