org.nuiton.util
Class MatrixMap.SemanticList<T>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<T>
          extended by org.nuiton.util.MatrixMap.SemanticList<T>
Type Parameters:
T -
All Implemented Interfaces:
Iterable<T>, Collection<T>, List<T>, RandomAccess
Enclosing interface:
MatrixMap<E>

public static class MatrixMap.SemanticList<T>
extends AbstractList<T>
implements RandomAccess

Collection particuliere utilisee pour la stockage des semantiques.

Sert a optimiser la recherche de la position d'une donnee dans la liste. Permet aussi de verifier qu'on ajoute pas de doublon dans la liste


Field Summary
protected  ArrayList<T> datas
           
protected  Map<T,Integer> index
           
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
MatrixMap.SemanticList()
           
MatrixMap.SemanticList(Collection<T> c)
           
 
Method Summary
 void add(int index, T element)
           
 T get(int index)
           
protected  Map<T,Integer> getIndex()
           
 int indexOf(Object o)
           
 T remove(int index)
           
 T set(int index, T element)
           
 int size()
           
 
Methods inherited from class java.util.AbstractList
add, addAll, clear, equals, hashCode, iterator, lastIndexOf, listIterator, listIterator, removeRange, 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
 

Field Detail

datas

protected ArrayList<T> datas

index

protected Map<T,Integer> index
Constructor Detail

MatrixMap.SemanticList

public MatrixMap.SemanticList()

MatrixMap.SemanticList

public MatrixMap.SemanticList(Collection<T> c)
Method Detail

get

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

add

public void add(int index,
                T element)
Specified by:
add in interface List<T>
Overrides:
add in class AbstractList<T>

set

public T set(int index,
             T element)
Specified by:
set in interface List<T>
Overrides:
set in class AbstractList<T>

remove

public T remove(int index)
Specified by:
remove in interface List<T>
Overrides:
remove 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>

indexOf

public int indexOf(Object o)
Specified by:
indexOf in interface List<T>
Overrides:
indexOf in class AbstractList<T>

getIndex

protected Map<T,Integer> getIndex()


Copyright © 2004-2012 CodeLutin. All Rights Reserved.