cz.cuni.amis.utils.collections
Class ListConcatenation<T>

Package class diagram package ListConcatenation
java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<T>
          extended by cz.cuni.amis.utils.collections.ListConcatenation<T>
All Implemented Interfaces:
Iterable<T>, Collection<T>, List<T>

public class ListConcatenation<T>
extends AbstractList<T>

An unmodifiable list that combines several child lists. The list represent view on the underlying lists, so if they are modified, so is this list. This class is not thread-safe (i.e. parallel modification to underlying lists may cause unexpected behaviour)

Author:
Martin Cerny

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ListConcatenation(List<List<T>> lists)
           
ListConcatenation(List<T>... lists)
           
 
Method Summary
static
<T> List<T>
concatenate(List<List<T>> lists)
          Concatenates lists into the most simple form.
static
<T> List<T>
concatenate(List<T>... lists)
           
 T get(int index)
           
 int size()
           
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

ListConcatenation

public ListConcatenation(List<List<T>> lists)

ListConcatenation

public ListConcatenation(List<T>... lists)
Method Detail

concatenate

public static <T> List<T> concatenate(List<T>... lists)

concatenate

public static <T> List<T> concatenate(List<List<T>> lists)
Concatenates lists into the most simple form.

Type Parameters:
T -
Parameters:
lists -
Returns:

get

public T get(int index)
Specified by:
get in interface List<T>
Specified by:
get in class AbstractList<T>

size

public int size()
Specified by:
size in interface Collection<T>
Specified by:
size in interface List<T>
Specified by:
size in class AbstractCollection<T>


Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.