Constructor and Description |
---|
AdditionOrderedSet()
Create a new set, with initialSize 16.
|
AdditionOrderedSet(int initialSize)
Create a new set with the specified initialSize.
|
AdditionOrderedSet(List<T> elts)
Create a new set, adding the specified elements in order.
|
AdditionOrderedSet(T[] elts)
Create a new set, adding the specified elements in order.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(T elt)
Add an element to the set.
|
boolean |
addAll(Iterable<T> items)
Add all items of a list to the set.
|
boolean |
contains(T elt)
Test if the set contains the given element.
|
static <T> List<T> |
dedup(List<T> list)
Deduplicate a list, keeping the elements in the same relative order.
|
Iterator<T> |
iterator() |
int |
size()
The number of elements in the set.
|
List<T> |
toList()
Get the elements in addition order (i.e.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public AdditionOrderedSet()
public AdditionOrderedSet(int initialSize)
initialSize
- The initialSize to allocate for the set.public AdditionOrderedSet(List<T> elts)
elts
- The elements to add.public AdditionOrderedSet(T[] elts)
elts
- The elements to add.public boolean add(T elt)
elt
- The element to add to the set.public boolean addAll(Iterable<T> items)
items
- The items to add to the set.public boolean contains(T elt)
elt
- The element to test for.public List<T> toList()
public static <T> List<T> dedup(List<T> list)
list
- The list to deduplicate.public int size()
Copyright © 2018. All rights reserved.