ua.gradsoft.javachecker.util
Class ImmutableMappedList<X,Y>

java.lang.Object
  extended by ua.gradsoft.javachecker.util.ImmutableMappedCollection<X,Y>
      extended by ua.gradsoft.javachecker.util.ImmutableMappedList<X,Y>
All Implemented Interfaces:
java.lang.Iterable<Y>, java.util.Collection<Y>, java.util.List<Y>

public class ImmutableMappedList<X,Y>
extends ImmutableMappedCollection<X,Y>
implements java.util.List<Y>

Immutable mapped list, which return mapping of original x by function.

Author:
rssh

Nested Class Summary
 class ImmutableMappedList.MappedListIterator
           
 
Field Summary
protected  java.util.List<X> lorigin_
           
 
Fields inherited from class ua.gradsoft.javachecker.util.ImmutableMappedCollection
f_, origin_
 
Constructor Summary
ImmutableMappedList(java.util.List<X> origin, Function<X,Y> f)
          Creates a new instance of ImmutableMappedList
 
Method Summary
 void add(int index, Y element)
           
 boolean addAll(int index, java.util.Collection<? extends Y> elements)
           
 Y get(int pos)
           
 int indexOf(java.lang.Object o)
           
 int lastIndexOf(java.lang.Object o)
           
 java.util.ListIterator<Y> listIterator()
           
 java.util.ListIterator<Y> listIterator(int i)
           
 Y remove(int x)
           
 Y set(int index, Y element)
           
 java.util.List<Y> subList(int l, int h)
           
 
Methods inherited from class ua.gradsoft.javachecker.util.ImmutableMappedCollection
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.List
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Field Detail

lorigin_

protected java.util.List<X> lorigin_
Constructor Detail

ImmutableMappedList

public ImmutableMappedList(java.util.List<X> origin,
                           Function<X,Y> f)
Creates a new instance of ImmutableMappedList

Method Detail

add

public void add(int index,
                Y element)
Specified by:
add in interface java.util.List<Y>

addAll

public boolean addAll(int index,
                      java.util.Collection<? extends Y> elements)
Specified by:
addAll in interface java.util.List<Y>

get

public Y get(int pos)
Specified by:
get in interface java.util.List<Y>

set

public Y set(int index,
             Y element)
Specified by:
set in interface java.util.List<Y>

remove

public Y remove(int x)
Specified by:
remove in interface java.util.List<Y>

indexOf

public int indexOf(java.lang.Object o)
Specified by:
indexOf in interface java.util.List<Y>

lastIndexOf

public int lastIndexOf(java.lang.Object o)
Specified by:
lastIndexOf in interface java.util.List<Y>

listIterator

public java.util.ListIterator<Y> listIterator()
Specified by:
listIterator in interface java.util.List<Y>

listIterator

public java.util.ListIterator<Y> listIterator(int i)
Specified by:
listIterator in interface java.util.List<Y>

subList

public java.util.List<Y> subList(int l,
                                 int h)
Specified by:
subList in interface java.util.List<Y>