Class NonIndexOutofBoundsArrayList<T>

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<T>
sootup.java.bytecode.frontend.conversion.NonIndexOutofBoundsArrayList<T>
All Implemented Interfaces:
Serializable, Cloneable, Iterable<T>, Collection<T>, List<T>, RandomAccess

public class NonIndexOutofBoundsArrayList<T> extends ArrayList<T>
a modified ArrayList which grows instead of throwing IndexOutOfBounds and behaves more like a (growing) array.
Author:
Markus Schmidt
See Also:
  • Constructor Details

    • NonIndexOutofBoundsArrayList

      public NonIndexOutofBoundsArrayList(int i)
  • Method Details

    • get

      public T get(int idx)
      returns null instead of IndexOutfBoundsException
      Specified by:
      get in interface List<T>
      Overrides:
      get in class ArrayList<T>
    • set

      public T set(int idx, T t)
      modified in the way that the underlying array grows if index >= size() and fills the gap with null elements instead of throwing an IndexOutOfBoundsException
      Specified by:
      set in interface List<T>
      Overrides:
      set in class ArrayList<T>