Package org.apache.commons.collections4
Class CollectionUtils.CardinalityHelper<O>
java.lang.Object
org.apache.commons.collections4.CollectionUtils.CardinalityHelper<O>
- Type Parameters:
O
- the element type
- Direct Known Subclasses:
CollectionUtils.SetOperationCardinalityHelper
- Enclosing class:
CollectionUtils
Helper class to easily access cardinality properties of two collections.
-
Field Summary
FieldsModifier and TypeFieldDescriptionContains the cardinality for each object in collection A.Contains the cardinality for each object in collection B. -
Constructor Summary
ConstructorsConstructorDescriptionCardinalityHelper
(Iterable<? extends O> a, Iterable<? extends O> b) Create a new CardinalityHelper for two collections. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the frequency of this object in collection A.int
Returns the frequency of this object in collection B.private int
final int
Returns the maximum frequency of an object.final int
Returns the minimum frequency of an object.
-
Field Details
-
cardinalityA
Contains the cardinality for each object in collection A. -
cardinalityB
Contains the cardinality for each object in collection B.
-
-
Constructor Details
-
CardinalityHelper
Create a new CardinalityHelper for two collections.- Parameters:
a
- the first collectionb
- the second collection
-
-
Method Details
-
max
Returns the maximum frequency of an object.- Parameters:
obj
- the object- Returns:
- the maximum frequency of the object
-
min
Returns the minimum frequency of an object.- Parameters:
obj
- the object- Returns:
- the minimum frequency of the object
-
freqA
Returns the frequency of this object in collection A.- Parameters:
obj
- the object- Returns:
- the frequency of the object in collection A
-
freqB
Returns the frequency of this object in collection B.- Parameters:
obj
- the object- Returns:
- the frequency of the object in collection B
-
getFreq
-