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) Creates a new CardinalityHelper for two collections. -
Method Summary
Modifier and TypeMethodDescription(package private) static booleanequals(Collection<?> a, Collection<?> b) intGets the frequency of this object in collection A.intGets the frequency of this object in collection B.private intfinal intGets the maximum frequency of an object.final intGets 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
Creates a new CardinalityHelper for two collections.- Parameters:
a- the first collectionb- the second collection
-
-
Method Details
-
equals
-
freqA
Gets the frequency of this object in collection A.- Parameters:
key- the key whose associated frequency is to be returned.- Returns:
- the frequency of the object in collection A
-
freqB
Gets the frequency of this object in collection B.- Parameters:
key- the key whose associated frequency is to be returned.- Returns:
- the frequency of the object in collection B
-
getFreq
-
max
Gets the maximum frequency of an object.- Parameters:
obj- the object- Returns:
- the maximum frequency of the object
-
min
Gets the minimum frequency of an object.- Parameters:
obj- the object- Returns:
- the minimum frequency of the object
-