Package randoop.util

Class OneMoreElementList<E>

    • Field Detail

      • lastElement

        public final E lastElement
        The last element in this.
      • list

        public final SimpleList<E> list
        All but the last element in this.
      • size

        public final int size
        The size of this.
    • Constructor Detail

      • OneMoreElementList

        public OneMoreElementList​(SimpleList<E> list,
                                  E extraElement)
    • Method Detail

      • size

        public int size()
        Description copied from interface: SimpleList
        Return the number of elements in this list.
        Specified by:
        size in interface SimpleList<E>
        Returns:
        the number of elements in this list
      • isEmpty

        public boolean isEmpty()
        Description copied from interface: SimpleList
        Test if this list is empty.
        Specified by:
        isEmpty in interface SimpleList<E>
        Returns:
        true if this list is empty, false otherwise
      • get

        public E get​(int index)
        Description copied from interface: SimpleList
        Return the element at the given position of this list.
        Specified by:
        get in interface SimpleList<E>
        Parameters:
        index - the position for the element
        Returns:
        the element at the index
      • getSublist

        public SimpleList<E> getSublist​(int index)
        Description copied from interface: SimpleList
        Return a sublist of this list that contains the index. Does not necessarily contain the first element.

        The result is always an existing SimpleList, the smallest one that contains the index. Currently, it is always a SimpleArrayList.

        Specified by:
        getSublist in interface SimpleList<E>
        Parameters:
        index - the index into this list
        Returns:
        the sublist containing this index
      • toJDKList

        public List<E> toJDKList()
        Description copied from interface: SimpleList
        Returns a java.util.List version of this list. Caution: this operation can be expensive.
        Specified by:
        toJDKList in interface SimpleList<E>
        Returns:
        List for this list