Class ArrayList1<E>

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
com.pnfsoftware.jeb.util.collect.ArrayList1<E>
Type Parameters:
E - element type
All Implemented Interfaces:
Cloneable, Iterable<E>, Collection<E>, List<E>, RandomAccess, SequencedCollection<E>

@Ser public final class ArrayList1<E> extends AbstractList<E> implements List<E>, RandomAccess, Cloneable
A list ideally suited to contain 0 or 1 element. If the list contains 2 or more elements, an ArrayList will be used internally. However, if there is a high degree of certainty that the list contains 2+ elements, it is better to use an ArrayList directly instead.
  • Constructor Details

    • ArrayList1

      public ArrayList1()
      Create an empty list.
    • ArrayList1

      public ArrayList1(E value)
      Create a list containing one value.
      Parameters:
      value - initial value
  • Method Details