java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<T>
org.nuiton.util.MatrixMap.SemanticList<T>
- Type Parameters:
T - FIXME
- All Implemented Interfaces:
java.lang.Iterable<T>, java.util.Collection<T>, java.util.List<T>, java.util.RandomAccess
- Enclosing interface:
- MatrixMap<E>
public static class MatrixMap.SemanticList<T>
extends java.util.AbstractList<T>
implements java.util.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
Fields
| Modifier and Type |
Field |
Description |
protected java.util.ArrayList<T> |
datas |
|
protected java.util.Map<T,java.lang.Integer> |
index |
|
Fields inherited from class java.util.AbstractList
modCount
-
-
Method Summary
| Modifier and Type |
Method |
Description |
void |
add(int index,
T element) |
|
T |
get(int index) |
|
protected java.util.Map<T,java.lang.Integer> |
getIndex() |
|
int |
indexOf(java.lang.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.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.lang.Iterable
forEach
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Field Details
-
protected java.util.ArrayList<T> datas
-
protected java.util.Map<T,java.lang.Integer> index
-
Constructor Details
-
-
public SemanticList(
java.util.Collection<T> c)
-
Method Details
-
- Specified by:
get in interface java.util.List<T>
- Specified by:
get in class java.util.AbstractList<T>
-
public void add(
int index,
T element)
- Specified by:
add in interface java.util.List<T>
- Overrides:
add in class java.util.AbstractList<T>
-
public T set(
int index,
T element)
- Specified by:
set in interface java.util.List<T>
- Overrides:
set in class java.util.AbstractList<T>
-
public T remove(
int index)
- Specified by:
remove in interface java.util.List<T>
- Overrides:
remove in class java.util.AbstractList<T>
-
public int size()
- Specified by:
size in interface java.util.Collection<T>
- Specified by:
size in interface java.util.List<T>
- Specified by:
size in class java.util.AbstractCollection<T>
-
public int indexOf(java.lang.Object o)
- Specified by:
indexOf in interface java.util.List<T>
- Overrides:
indexOf in class java.util.AbstractList<T>
-
protected java.util.Map<T,java.lang.Integer> getIndex()