Package dev.nm.combinatorics
Class Ties<T>
- java.lang.Object
-
- dev.nm.combinatorics.Ties<T>
-
- Type Parameters:
T
- the type of objects, which must have a sensibleequals()
andhashCode()
methods
public class Ties<T> extends Object
Count the number of occurrences of each distinctive value.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
get(T obj)
Get the number of occurrences of an object.Set<T>
objects()
Get the set of objects counted.Collection<Long>
values()
Get the numbers of occurrences of the objects.
-
-
-
Method Detail
-
values
public Collection<Long> values()
Get the numbers of occurrences of the objects.- Returns:
- the numbers of occurrences of the objects
-
get
public long get(T obj)
Get the number of occurrences of an object.- Parameters:
obj
- an object- Returns:
- the number of occurrences
-
-