@@ -24,9 +24,14 @@ interface SegmentsAndData {
2424 }
2525
2626 /**
27- * Wrap {@code readData} and create one segment comprising the entire {@code
27+ * Wrap a {@link ReadData} and create one segment comprising the entire
28+ * {@code
2829 * readData}. The segment can be retrieved as the first (and only) element
2930 * of {@link SegmentedReadData#segments()}.
31+ *
32+ * @param readData
33+ * the ReadData to wrap
34+ * @return the SegmentedReadData
3035 */
3136 static SegmentedReadData wrap (ReadData readData ) {
3237 return new DefaultSegmentedReadData (readData );
@@ -35,8 +40,15 @@ static SegmentedReadData wrap(ReadData readData) {
3540 /**
3641 * Wrap {@code readData} and create segments at the given locations. The
3742 * order of segments in the returned {@link SegmentsAndData#segments()} list
38- * matches the order of the given {@code locations} (while the {@link
39- * #segments} in the {@link SegmentsAndData#data()} are ordered by offset).
43+ * matches the order of the given {@code locations} (while the
44+ * {@link #segments} in the {@link SegmentsAndData#data()} are ordered by
45+ * offset).
46+ *
47+ * @param readData
48+ * the ReadData to wrap
49+ * @param locations
50+ * the ranges for segments
51+ * @return the SegmentsAndData
4052 */
4153 static SegmentsAndData wrap (ReadData readData , Range ... locations ) {
4254 return wrap (readData , Arrays .asList (locations ));
@@ -45,8 +57,15 @@ static SegmentsAndData wrap(ReadData readData, Range... locations) {
4557 /**
4658 * Wrap {@code readData} and create segments at the given locations. The
4759 * order of segments in the returned {@link SegmentsAndData#segments()} list
48- * matches the order of the given {@code locations} (while the {@link
49- * #segments} in the {@link SegmentsAndData#data()} are ordered by offset).
60+ * matches the order of the given {@code locations} (while the
61+ * {@link #segments} in the {@link SegmentsAndData#data()} are ordered by
62+ * offset).
63+ *
64+ * @param readData
65+ * the ReadData to wrap
66+ * @param locations
67+ * the ranges for segments
68+ * @return the SegmentsAndData
5069 */
5170 static SegmentsAndData wrap (ReadData readData , List <Range > locations ) {
5271 return DefaultSegmentedReadData .wrap (readData , locations );
@@ -57,41 +76,45 @@ static SegmentsAndData wrap(ReadData readData, List<Range> locations) {
5776 * given {@code readDatas}. The concatenation contains the segments of all
5877 * concatenated {@code readData}s with appropriately offset locations.
5978 * <p>
60- * In particular, it is also possible to concatenate {@code SegmentedReadData}s
61- * with (yet) unknown length. (This is useful for postponing compression of
62- * DataBlocks until they are actually written.) In that case, segment locations
63- * are only available after all lengths become known. This happens when
64- * concatenation (or all its constituents) is {@link #materialize()
65- * materialized} or {@link #writeTo(OutputStream) written}.
79+ * In particular, it is also possible to concatenate
80+ * {@code SegmentedReadData}s with (yet) unknown length. (This is useful for
81+ * postponing compression of DataBlocks until they are actually written.) In
82+ * that case, segment locations are only available after all lengths become
83+ * known. This happens when concatenation (or all its constituents) is
84+ * {@link #materialize() materialized} or {@link #writeTo(OutputStream)
85+ * written}.
86+ *
87+ * @param readDatas
88+ * a list of ReadDatra to concatenate
89+ * @return the SegmentedReadData comprising all the input readDatas
6690 */
6791 static SegmentedReadData concatenate (List <SegmentedReadData > readDatas ) {
6892 return new ConcatenatedReadData (readDatas );
6993 }
7094
71-
72-
7395 /**
7496 * Returns the location of {@code segment} in this {@code ReadData}.
7597 * <p>
76- * Note that this {@code ReadData} is not necessarily the source of the segment.
98+ * Note that this {@code ReadData} is not necessarily the source of the
99+ * segment.
77100 * <p>
78101 * The returned {@code Range} may be {@code {offset=0, length=-1}}, which
79- * means that the segment comprises this whole {@code ReadData} (and the length of
80- * this {@code ReadData} is not yet known).
102+ * means that the segment comprises this whole {@code ReadData} (and the
103+ * length of this {@code ReadData} is not yet known).
81104 *
82105 * @param segment
83- * the segment id
106+ * the segment id
84107 *
85108 * @return location of the segment, or null
86109 *
87110 * @throws IllegalArgumentException
88- * if the segment is not contained in this ReadData
111+ * if the segment is not contained in this ReadData
89112 */
90113 Range location (Segment segment ) throws IllegalArgumentException ;
91114
92115 /**
93- * Return all segments (fully) contained in this {@code ReadData}, ordered by location
94- * (that is, sorted by {@link Range#COMPARATOR}).
116+ * Return all segments (fully) contained in this {@code ReadData}, ordered
117+ * by location (that is, sorted by {@link Range#COMPARATOR}).
95118 *
96119 * @return all segments contained in this {@code ReadData}.
97120 */
0 commit comments