Class Ties<T>

  • Type Parameters:
    T - the type of objects, which must have a sensible equals() and hashCode() methods

    public class Ties<T>
    extends Object
    Count the number of occurrences of each distinctive value.
    • Constructor Detail

      • Ties

        public Ties​(List<T> objects)
        Count the number of occurrences of each distinctive value.
        Parameters:
        objects - the objects in which to count ties
    • Method Detail

      • objects

        public Set<T> objects()
        Get the set of objects counted.
        Returns:
        the set of objects counted
      • 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