Package com.senzing.g2.engine.plugin
Class ArraySet<T>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<T>
-
- com.senzing.g2.engine.plugin.ArraySet<T>
-
- All Implemented Interfaces:
Iterable<T>
,Collection<T>
,Set<T>
public class ArraySet<T> extends AbstractSet<T> implements Set<T>
-
-
Constructor Summary
Constructors Constructor Description ArraySet()
Default constructor.ArraySet(int initialCapacity)
Constructs a new instance with the specified initial capacity.ArraySet(Collection<? extends T> elements)
Constructs a new instance with the unique elements in the specifiedCollection
.ArraySet(T[] elements)
Constructs a new instance with the unique elements in the specified array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(T elem)
void
clear()
boolean
contains(Object elem)
Iterator<T>
iterator()
boolean
remove(Object elem)
boolean
removeAll(Collection<?> c)
boolean
retainAll(Collection<?> c)
int
size()
Object[]
toArray()
<E> E[]
toArray(E[] array)
-
Methods inherited from class java.util.AbstractSet
equals, hashCode
-
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, 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.util.Set
addAll, containsAll, equals, hashCode, isEmpty, spliterator
-
-
-
-
Constructor Detail
-
ArraySet
public ArraySet()
Default constructor.
-
ArraySet
public ArraySet(int initialCapacity)
Constructs a new instance with the specified initial capacity.- Parameters:
initialCapacity
- The initial capacity of the set.
-
ArraySet
public ArraySet(T[] elements)
Constructs a new instance with the unique elements in the specified array.- Parameters:
elements
- The array of elements.
-
ArraySet
public ArraySet(Collection<? extends T> elements)
Constructs a new instance with the unique elements in the specifiedCollection
.- Parameters:
elements
- The elements.
-
-
Method Detail
-
size
public int size()
- Specified by:
size
in interfaceCollection<T>
- Specified by:
size
in interfaceSet<T>
- Specified by:
size
in classAbstractCollection<T>
-
add
public boolean add(T elem)
- Specified by:
add
in interfaceCollection<T>
- Specified by:
add
in interfaceSet<T>
- Overrides:
add
in classAbstractCollection<T>
-
contains
public boolean contains(Object elem)
- Specified by:
contains
in interfaceCollection<T>
- Specified by:
contains
in interfaceSet<T>
- Overrides:
contains
in classAbstractCollection<T>
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection<T>
- Specified by:
clear
in interfaceSet<T>
- Overrides:
clear
in classAbstractCollection<T>
-
remove
public boolean remove(Object elem)
- Specified by:
remove
in interfaceCollection<T>
- Specified by:
remove
in interfaceSet<T>
- Overrides:
remove
in classAbstractCollection<T>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAll
in interfaceCollection<T>
- Specified by:
removeAll
in interfaceSet<T>
- Overrides:
removeAll
in classAbstractSet<T>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAll
in interfaceCollection<T>
- Specified by:
retainAll
in interfaceSet<T>
- Overrides:
retainAll
in classAbstractCollection<T>
-
toArray
public Object[] toArray()
- Specified by:
toArray
in interfaceCollection<T>
- Specified by:
toArray
in interfaceSet<T>
- Overrides:
toArray
in classAbstractCollection<T>
-
toArray
public <E> E[] toArray(E[] array)
- Specified by:
toArray
in interfaceCollection<T>
- Specified by:
toArray
in interfaceSet<T>
- Overrides:
toArray
in classAbstractCollection<T>
-
-