Skip to content

Commit

Permalink
[Java] Improve Javadoc for ArrayUtil.
Browse files Browse the repository at this point in the history
  • Loading branch information
jvirtanen committed Sep 7, 2020
1 parent 1b0131b commit 370b762
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions agrona/src/main/java/org/agrona/collections/ArrayUtil.java
Expand Up @@ -103,6 +103,17 @@ public static <T> T[] remove(final T[] oldElements, final T elementToRemove)
return remove(oldElements, index);
}

/**
* Remove an element from an array resulting in a new array if the index was inside the array otherwise the old
* array.
* <p>
* Returns the input parameter if the index isn't inside the array.
*
* @param oldElements to have the element removed from.
* @param index to remove the element at.
* @param <T> type of the array.
* @return a new array without the element if the index is inside the array otherwise the original array.
*/
public static <T> T[] remove(final T[] oldElements, final int index)
{
if (index == UNKNOWN_INDEX)
Expand Down

0 comments on commit 370b762

Please sign in to comment.