Class CollectionUtils.CardinalityHelper<O>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.util.Map<O,​java.lang.Integer> cardinalityA
      Contains the cardinality for each object in collection A.
      (package private) java.util.Map<O,​java.lang.Integer> cardinalityB
      Contains the cardinality for each object in collection B.
    • Constructor Summary

      Constructors 
      Constructor Description
      CardinalityHelper​(java.lang.Iterable<? extends O> a, java.lang.Iterable<? extends O> b)
      Create a new CardinalityHelper for two collections.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int freqA​(java.lang.Object obj)
      Returns the frequency of this object in collection A.
      int freqB​(java.lang.Object obj)
      Returns the frequency of this object in collection B.
      private int getFreq​(java.lang.Object obj, java.util.Map<?,​java.lang.Integer> freqMap)  
      int max​(java.lang.Object obj)
      Returns the maximum frequency of an object.
      int min​(java.lang.Object obj)
      Returns the minimum frequency of an object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • cardinalityA

        final java.util.Map<O,​java.lang.Integer> cardinalityA
        Contains the cardinality for each object in collection A.
      • cardinalityB

        final java.util.Map<O,​java.lang.Integer> cardinalityB
        Contains the cardinality for each object in collection B.
    • Constructor Detail

      • CardinalityHelper

        public CardinalityHelper​(java.lang.Iterable<? extends O> a,
                                 java.lang.Iterable<? extends O> b)
        Create a new CardinalityHelper for two collections.
        Parameters:
        a - the first collection
        b - the second collection
    • Method Detail

      • max

        public final int max​(java.lang.Object obj)
        Returns the maximum frequency of an object.
        Parameters:
        obj - the object
        Returns:
        the maximum frequency of the object
      • min

        public final int min​(java.lang.Object obj)
        Returns the minimum frequency of an object.
        Parameters:
        obj - the object
        Returns:
        the minimum frequency of the object
      • freqA

        public int freqA​(java.lang.Object obj)
        Returns the frequency of this object in collection A.
        Parameters:
        obj - the object
        Returns:
        the frequency of the object in collection A
      • freqB

        public int freqB​(java.lang.Object obj)
        Returns the frequency of this object in collection B.
        Parameters:
        obj - the object
        Returns:
        the frequency of the object in collection B
      • getFreq

        private int getFreq​(java.lang.Object obj,
                            java.util.Map<?,​java.lang.Integer> freqMap)