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 booleanadd(T elem)voidclear()booleancontains(Object elem)Iterator<T>iterator()booleanremove(Object elem)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)intsize()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:
sizein interfaceCollection<T>- Specified by:
sizein interfaceSet<T>- Specified by:
sizein classAbstractCollection<T>
-
add
public boolean add(T elem)
- Specified by:
addin interfaceCollection<T>- Specified by:
addin interfaceSet<T>- Overrides:
addin classAbstractCollection<T>
-
contains
public boolean contains(Object elem)
- Specified by:
containsin interfaceCollection<T>- Specified by:
containsin interfaceSet<T>- Overrides:
containsin classAbstractCollection<T>
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<T>- Specified by:
clearin interfaceSet<T>- Overrides:
clearin classAbstractCollection<T>
-
remove
public boolean remove(Object elem)
- Specified by:
removein interfaceCollection<T>- Specified by:
removein interfaceSet<T>- Overrides:
removein classAbstractCollection<T>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<T>- Specified by:
removeAllin interfaceSet<T>- Overrides:
removeAllin classAbstractSet<T>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAllin interfaceCollection<T>- Specified by:
retainAllin interfaceSet<T>- Overrides:
retainAllin classAbstractCollection<T>
-
toArray
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection<T>- Specified by:
toArrayin interfaceSet<T>- Overrides:
toArrayin classAbstractCollection<T>
-
toArray
public <E> E[] toArray(E[] array)
- Specified by:
toArrayin interfaceCollection<T>- Specified by:
toArrayin interfaceSet<T>- Overrides:
toArrayin classAbstractCollection<T>
-
-