/** * Modified version of {@link List#add(int, Object)} which fills null in the empty spaces if index * > size() instead of throwing IndexOutOfBoundsException. */ @Override public void add(int index, Object element) { int size = list.size(); while (index > size++) { list.add(null); } list.add(JsonValueBuilder.initFromObject(element)); }
@Override public boolean containsAll(Collection<?> c) { for (Object o : c) { if (list.contains(JsonValueBuilder.initFromObject(o)) == false) { return false; } } return true; }
@Override public boolean contains(Object o) { return list.contains(JsonValueBuilder.initFromObject(o)); }
@Override public int lastIndexOf(Object o) { return list.lastIndexOf(JsonValueBuilder.initFromObject(o)); }