net.sourceforge.plantuml.quantization.Multiset Maven / Gradle / Ivy
package net.sourceforge.plantuml.quantization;
import java.util.Collection;
import java.util.Set;
/**
* A collection which permits duplicates, and provides methods adding/removing
* several counts of an element.
*
* @param the element type
*/
public interface Multiset extends Collection {
/**
* Add n counts of an element.
*
* @param element the element to add
* @param n how many to add
*/
public void add(E element, int n);
/**
* Remove up to n counts of an element.
*
* @param element the element the remove
* @param n how many to remove
* @return the number of elements removed
*/
public int remove(Object element, int n);
public int count(Object element);
public Set getDistinctElements();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy