@@ -82,7 +82,7 @@ private TinyBag(final int initialCapacity) {
82
82
/**
83
83
* Adds a new element to the bag, incrementing its count in the underlying map.
84
84
*
85
- * @param object the object to add
85
+ * @param object the object to add.
86
86
*/
87
87
private void add (final T object ) {
88
88
map .computeIfAbsent (object , k -> new BagCount ()).count ++;
@@ -91,7 +91,7 @@ private void add(final T object) {
91
91
/**
92
92
* Returns a Set view of the mappings contained in this bag.
93
93
*
94
- * @return The Set view
94
+ * @return The Set view.
95
95
*/
96
96
private Set <Entry <T , BagCount >> entrySet () {
97
97
return map .entrySet ();
@@ -101,8 +101,8 @@ private Set<Entry<T, BagCount>> entrySet() {
101
101
* Returns the number of occurrence of the given element in this bag by
102
102
* looking up its count in the underlying map.
103
103
*
104
- * @param object the object to search for
105
- * @return The number of occurrences of the object, zero if not found
104
+ * @param object the object to search for.
105
+ * @return The number of occurrences of the object, zero if not found.
106
106
*/
107
107
private int getCount (final Object object ) {
108
108
return map .getOrDefault (object , BagCount .ZERO ).count ;
@@ -111,7 +111,7 @@ private int getCount(final Object object) {
111
111
/**
112
112
* Gets the number of unique elements in the bag.
113
113
*
114
- * @return The unique element size
114
+ * @return The unique element size.
115
115
*/
116
116
private int uniqueElementSize () {
117
117
return map .size ();
@@ -122,10 +122,10 @@ private int uniqueElementSize() {
122
122
* Computes the intersection between two sets. This is the count of all the elements
123
123
* that are within both sets.
124
124
*
125
- * @param <T> the type of the elements in the set
126
- * @param setA the set A
127
- * @param setB the set B
128
- * @return The intersection
125
+ * @param <T> the type of the elements in the set.
126
+ * @param setA the set A.
127
+ * @param setB the set B.
128
+ * @return The intersection of A and B.
129
129
*/
130
130
private static <T > int getIntersection (final Set <T > setA , final Set <T > setB ) {
131
131
int intersection = 0 ;
@@ -149,8 +149,8 @@ private static <T> int getIntersection(final Set<T> setA, final Set<T> setB) {
149
149
* that will include duplicates in the intersect and union.
150
150
* </p>
151
151
*
152
- * @param converter the converter used to create the elements from the characters
153
- * @throws IllegalArgumentException if the converter is null
152
+ * @param converter the converter used to create the elements from the characters.
153
+ * @throws IllegalArgumentException if the converter is null.
154
154
*/
155
155
public IntersectionSimilarity (final Function <CharSequence , Collection <T >> converter ) {
156
156
if (converter == null ) {
@@ -162,10 +162,10 @@ public IntersectionSimilarity(final Function<CharSequence, Collection<T>> conver
162
162
/**
163
163
* Calculates the intersection of two character sequences passed as input.
164
164
*
165
- * @param left first character sequence
166
- * @param right second character sequence
167
- * @return The intersection result
168
- * @throws IllegalArgumentException if either input sequence is {@code null}
165
+ * @param left first character sequence.
166
+ * @param right second character sequence.
167
+ * @return The intersection result.
168
+ * @throws IllegalArgumentException if either input sequence is {@code null}.
169
169
*/
170
170
@ Override
171
171
public IntersectionResult apply (final CharSequence left , final CharSequence right ) {
@@ -210,9 +210,9 @@ public IntersectionResult apply(final CharSequence left, final CharSequence righ
210
210
* Computes the intersection between two bags. This is the sum of the minimum
211
211
* count of each element that is within both sets.
212
212
*
213
- * @param bagA the bag A
214
- * @param bagB the bag B
215
- * @return The intersection
213
+ * @param bagA the bag A.
214
+ * @param bagB the bag B.
215
+ * @return The intersection of A and B.
216
216
*/
217
217
private int getIntersection (final TinyBag bagA , final TinyBag bagB ) {
218
218
int intersection = 0 ;
@@ -229,8 +229,8 @@ private int getIntersection(final TinyBag bagA, final TinyBag bagB) {
229
229
* Converts the collection to a bag. The bag will contain the count of each element
230
230
* in the collection.
231
231
*
232
- * @param objects the objects
233
- * @return The bag
232
+ * @param objects the objects.
233
+ * @return The bag.
234
234
*/
235
235
private TinyBag toBag (final Collection <T > objects ) {
236
236
final TinyBag bag = new TinyBag (objects .size ());
0 commit comments