Class SparseMultiset<T,K>
java.lang.Object
dev.kkorolyov.flub.data.SparseMultiset<T,K>
- All Implemented Interfaces:
Iterable<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintAdds a newelementand returns its index to use for subsequent modifications.booleanget(int i) Returns the element at indexi.Returns all elements associated with allkeys.inthashCode()iterator()voidAssociateskeyswith element at indexi.booleanremove(int i) Removes element at indexiand returns whether such an element existed.voidRemoves associations tokeysfor element at indexi.toString()Methods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
SparseMultiset
public SparseMultiset()
-
-
Method Details
-
get
Returns the element at indexi. -
get
-
add
Adds a newelementand returns its index to use for subsequent modifications.- Throws:
IllegalArgumentException- ifelementisnull- See Also:
-
remove
public boolean remove(int i) Removes element at indexiand returns whether such an element existed. -
put
-
remove
-
iterator
-
equals
-
hashCode
-
toString
-