Package org.locationtech.jts.jump.util
Class UniqueList
- java.lang.Object
-
- org.locationtech.jts.jump.util.UniqueList
-
- All Implemented Interfaces:
Iterable
,Collection
,List
public class UniqueList extends Object implements List
A List that ignores duplicates. Note: performance is not optimized - a simple linear search is performed.
-
-
Constructor Summary
Constructors Constructor Description UniqueList()
Creates a UniqueList.UniqueList(List list)
Creates a UniqueList backed by the given List.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, Object element)
boolean
add(Object o)
boolean
addAll(int index, Collection c)
boolean
addAll(Collection c)
void
clear()
boolean
contains(Object o)
boolean
containsAll(Collection c)
boolean
equals(Object o)
Object
get(int index)
int
indexOf(Object o)
boolean
isEmpty()
Iterator
iterator()
int
lastIndexOf(Object o)
ListIterator
listIterator()
ListIterator
listIterator(int index)
Object
remove(int index)
boolean
remove(Object o)
boolean
removeAll(Collection c)
boolean
retainAll(Collection c)
Object
set(int index, Object element)
int
size()
List
subList(int fromIndex, int toIndex)
Object[]
toArray()
Object[]
toArray(Object[] a)
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
hashCode, replaceAll, sort, spliterator
-
-
-
-
Constructor Detail
-
UniqueList
public UniqueList()
Creates a UniqueList.
-
UniqueList
public UniqueList(List list)
Creates a UniqueList backed by the given List.- Parameters:
list
- a List that will be this UniqueList's underlying List
-
-
Method Detail
-
size
public int size()
- Specified by:
size
in interfaceCollection
- Specified by:
size
in interfaceList
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceCollection
- Specified by:
isEmpty
in interfaceList
-
contains
public boolean contains(Object o)
- Specified by:
contains
in interfaceCollection
- Specified by:
contains
in interfaceList
-
iterator
public Iterator iterator()
-
toArray
public Object[] toArray()
- Specified by:
toArray
in interfaceCollection
- Specified by:
toArray
in interfaceList
-
toArray
public Object[] toArray(Object[] a)
- Specified by:
toArray
in interfaceCollection
- Specified by:
toArray
in interfaceList
-
add
public boolean add(Object o)
- Specified by:
add
in interfaceCollection
- Specified by:
add
in interfaceList
-
remove
public boolean remove(Object o)
- Specified by:
remove
in interfaceCollection
- Specified by:
remove
in interfaceList
-
containsAll
public boolean containsAll(Collection c)
- Specified by:
containsAll
in interfaceCollection
- Specified by:
containsAll
in interfaceList
-
addAll
public boolean addAll(Collection c)
- Specified by:
addAll
in interfaceCollection
- Specified by:
addAll
in interfaceList
-
addAll
public boolean addAll(int index, Collection c)
-
removeAll
public boolean removeAll(Collection c)
- Specified by:
removeAll
in interfaceCollection
- Specified by:
removeAll
in interfaceList
-
retainAll
public boolean retainAll(Collection c)
- Specified by:
retainAll
in interfaceCollection
- Specified by:
retainAll
in interfaceList
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection
- Specified by:
clear
in interfaceList
-
equals
public boolean equals(Object o)
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOf
in interfaceList
-
listIterator
public ListIterator listIterator()
- Specified by:
listIterator
in interfaceList
-
listIterator
public ListIterator listIterator(int index)
- Specified by:
listIterator
in interfaceList
-
-