randoop.util
Class ListOfLists<T>

Object
  extended by SimpleList<T>
      extended by ListOfLists<T>
All Implemented Interfaces:
Serializable

public class ListOfLists<T>
extends SimpleList<T>
implements Serializable

Given a list of lists, defines methods that can access all the elements as if they were part of a single list, without actually merging the lists. This class is used for performance reasons. We want the ability to select elements collected across several lists, but we observed that creating a brand new list (i.e. via a sequence of List.addAll(..) operations can be very expensive, because it happened in a hot spot (method SequenceCollection.getSequencesThatYield).

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
 List<SimpleList<T>> lists
           
 
Constructor Summary
Constructor and Description
ListOfLists(List<SimpleList<T>> lists)
           
ListOfLists(SimpleList<T>... lists)
           
 
Method Summary
Modifier and Type Method and Description
 T get(int index)
           
 int size()
           
 List<T> toJDKList()
          Returns a java.util.List version of this list.
 String toString()
           
 
Methods inherited from class SimpleList
isEmpty
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

lists

public final List<SimpleList<T>> lists
Constructor Detail

ListOfLists

public ListOfLists(SimpleList<T>... lists)

ListOfLists

public ListOfLists(List<SimpleList<T>> lists)
Method Detail

size

public int size()
Specified by:
size in class SimpleList<T>

get

public T get(int index)
Specified by:
get in class SimpleList<T>

toJDKList

public List<T> toJDKList()
Description copied from class: SimpleList
Returns a java.util.List version of this list.

Specified by:
toJDKList in class SimpleList<T>

toString

public String toString()
Overrides:
toString in class Object