Package org.smallmind.nutsnbolts.util
Class HashBag<T>
- java.lang.Object
-
- org.smallmind.nutsnbolts.util.HashBag<T>
-
- All Implemented Interfaces:
Iterable<T>,Collection<T>,Bag<T>
public class HashBag<T> extends Object implements Bag<T>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(T t)booleanadd(T t, int multiple)booleanaddAll(Collection<? extends T> c)voidclear()booleancontains(Object obj)booleancontainsAll(Collection<?> c)booleancontainsAll(Bag<?> b)Set<Map.Entry<T,Integer>>entrySet()booleanequals(Object obj)Integerget(T t)inthashCode()booleanisEmpty()Iterator<T>iterator()Set<T>keySet()booleanremove(Object obj)booleanremove(T t, int multiple)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)intsize()T[]toArray()<T1> T1[]toArray(T1[] a)-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.smallmind.nutsnbolts.util.Bag
spliterator
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
-
-
-
Constructor Detail
-
HashBag
public HashBag()
-
HashBag
public HashBag(Collection<? extends T> c)
-
-
Method Detail
-
size
public int size()
- Specified by:
sizein interfaceCollection<T>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection<T>
-
contains
public boolean contains(Object obj)
- Specified by:
containsin interfaceCollection<T>
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<T>
-
containsAll
public boolean containsAll(Bag<?> b)
-
add
public boolean add(T t)
- Specified by:
addin interfaceCollection<T>
-
remove
public boolean remove(Object obj)
- Specified by:
removein interfaceCollection<T>
-
addAll
public boolean addAll(Collection<? extends T> c)
- Specified by:
addAllin interfaceCollection<T>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<T>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAllin interfaceCollection<T>
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<T>
-
toArray
public T[] toArray()
- Specified by:
toArrayin interfaceCollection<T>
-
toArray
public <T1> T1[] toArray(T1[] a)
- Specified by:
toArrayin interfaceCollection<T>
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceCollection<T>- Overrides:
hashCodein classObject
-
-