Skip to content

Commit 61e4ae1

Browse files
committed
Mindless javadoc improvement
1 parent 7f0d8a4 commit 61e4ae1

File tree

1 file changed

+28
-24
lines changed

1 file changed

+28
-24
lines changed

src/edu/stanford/nlp/util/Pair.java

+28-24
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package edu.stanford.nlp.util;
22

3-
import java.io.DataInputStream;
43
import java.io.DataOutputStream;
4+
import java.io.Serial;
55
import java.io.Serializable;
66
import java.util.Comparator;
77
import java.util.List;
@@ -105,10 +105,10 @@ public static <X, Y> Pair<X, Y> makePair(X x, Y y) {
105105

106106
/**
107107
* Write a string representation of a Pair to a DataStream.
108-
* The <code>toString()</code> method is called on each of the pair
109-
* of objects and a <code>String</code> representation is written.
108+
* The {@code toString()} method is called on each of the pair
109+
* of objects and a {@code String} representation is written.
110110
* This might not allow one to recover the pair of objects unless they
111-
* are of type <code>String</code>.
111+
* are of type {@code String}.
112112
*/
113113
public void save(DataOutputStream out) {
114114
try {
@@ -120,24 +120,24 @@ public void save(DataOutputStream out) {
120120
}
121121

122122
/**
123-
* Compares this <code>Pair</code> to another object.
124-
* If the object is a <code>Pair</code>, this function will work providing
125-
* the elements of the <code>Pair</code> are themselves comparable.
123+
* Compares this {@code Pair} to another object.
124+
* If the object is a {@code Pair}, this function will work providing
125+
* the elements of the {@code Pair} are themselves comparable.
126126
* It will then return a value based on the pair of objects, where
127127
* <code>p &gt; q iff p.first() &gt; q.first() ||
128128
* (p.first().equals(q.first()) && p.second() &gt; q.second())</code>.
129-
* If the other object is not a <code>Pair</code>, it throws a
130-
* <code>ClassCastException</code>.
129+
* If the other object is not a {@code Pair}, it throws a
130+
* {@code ClassCastException}.
131131
*
132132
* @param another the <code>Object</code> to be compared.
133133
* @return the value <code>0</code> if the argument is a
134-
* <code>Pair</code> equal to this <code>Pair</code>; a value less than
135-
* <code>0</code> if the argument is a <code>Pair</code>
136-
* greater than this <code>Pair</code>; and a value
134+
* {@code Pair} equal to this {@code Pair}; a value less than
135+
* <code>0</code> if the argument is a {@code Pair}
136+
* greater than this {@code Pair}; and a value
137137
* greater than <code>0</code> if the argument is a
138-
* <code>Pair</code> less than this <code>Pair</code>.
138+
* {@code Pair} less than this {@code Pair}.
139139
* @throws ClassCastException if the argument is not a
140-
* <code>Pair</code>.
140+
* {@code Pair}.
141141
* @see java.lang.Comparable
142142
*/
143143
@SuppressWarnings("unchecked")
@@ -196,6 +196,7 @@ public static Pair<String, String> internedStringPair(String first, String secon
196196
/**
197197
* use serialVersionUID for cross version serialization compatibility
198198
*/
199+
@Serial
199200
private static final long serialVersionUID = 1360822168806852921L;
200201

201202

@@ -211,6 +212,7 @@ private MutableInternedPair(String first, String second) {
211212
internStrings();
212213
}
213214

215+
@Serial
214216
protected Object readResolve() {
215217
internStrings();
216218
return this;
@@ -226,6 +228,7 @@ private void internStrings() {
226228
}
227229

228230
// use serialVersionUID for cross version serialization compatibility
231+
@Serial
229232
private static final long serialVersionUID = 1360822168806852922L;
230233

231234
}
@@ -238,10 +241,10 @@ public void prettyLog(RedwoodChannels channels, String description) {
238241
}
239242

240243
/**
241-
* Compares a <code>Pair</code> to another <code>Pair</code> according to the first object of the pair only
242-
* This function will work providing
243-
* the first element of the <code>Pair</code> is comparable, otherwise will throw a
244-
* <code>ClassCastException</code>
244+
* Compares a {@code Pair} to another {@code Pair} according to the first object of the pair only
245+
* This function will work providing the first element of the {@code Pair} is comparable,
246+
* otherwise will throw a {@code ClassCastException}.
247+
*
245248
* @author jonathanberant
246249
*/
247250
public static class ByFirstPairComparator<T1,T2> implements Comparator<Pair<T1,T2>> {
@@ -254,9 +257,9 @@ public int compare(Pair<T1, T2> pair1, Pair<T1, T2> pair2) {
254257
}
255258

256259
/**
257-
* Compares a <code>Pair</code> to another <code>Pair</code> according to the first object of the pair only in decreasing order
260+
* Compares a {@code Pair} to another {@code Pair} according to the first object of the pair only in decreasing order
258261
* This function will work providing
259-
* the first element of the <code>Pair</code> is comparable, otherwise will throw a
262+
* the first element of the {@code Pair} is comparable, otherwise will throw a
260263
* <code>ClassCastException</code>
261264
* @author jonathanberant
262265
*/
@@ -270,9 +273,9 @@ public int compare(Pair<T1, T2> pair1, Pair<T1, T2> pair2) {
270273
}
271274

272275
/**
273-
* Compares a <code>Pair</code> to another <code>Pair</code> according to the second object of the pair only
276+
* Compares a {@code Pair} to another {@code Pair} according to the second object of the pair only
274277
* This function will work providing
275-
* the first element of the <code>Pair</code> is comparable, otherwise will throw a
278+
* the first element of the {@code Pair} is comparable, otherwise will throw a
276279
* <code>ClassCastException</code>
277280
* @author jonathanberant
278281
*/
@@ -286,10 +289,11 @@ public int compare(Pair<T1, T2> pair1, Pair<T1, T2> pair2) {
286289
}
287290

288291
/**
289-
* Compares a <code>Pair</code> to another <code>Pair</code> according to the second object of the pair only in decreasing order
292+
* Compares a {@code Pair} to another {@code Pair} according to the second object of the pair only in decreasing order
290293
* This function will work providing
291-
* the first element of the <code>Pair</code> is comparable, otherwise will throw a
294+
* the first element of the {@code Pair} is comparable, otherwise will throw a
292295
* <code>ClassCastException</code>
296+
*
293297
* @author jonathanberant
294298
*/
295299
public static class BySecondReversePairComparator<T1,T2> implements Comparator<Pair<T1,T2>> {

0 commit comments

Comments
 (0)