Skip to content
This repository has been archived by the owner on Feb 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #34 from nitu2003/master
Browse files Browse the repository at this point in the history
NO MORE IndexOutOfBoundsException!
  • Loading branch information
hykilpikonna authored Jan 24, 2020
2 parents 3803456 + 4fca89b commit 4991c6e
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/main/java/cc/moecraft/icq/utils/HyArrayList.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package cc.moecraft.icq.utils;

import java.util.ArrayList;
import java.util.Collection;

public class HyArrayList<E> extends ArrayList<E> {

public HyArrayList() {
super();
}

public HyArrayList(int initialCapacity) {
super(initialCapacity);
}

public HyArrayList(Collection<? extends E> coll) {
super(coll);
}

public static <E> HyArrayList<E> of(Collection<E> list) {
return new HyArrayList<>(list);
}

@Override
public E get(int index) {
return index >= size() ? null : super.get(index);
}

}

0 comments on commit 4991c6e

Please sign in to comment.