1414import org .postgresql .util .PGobject ;
1515
1616/**
17- * PGsparsevec class
17+ * A sparse vector.
1818 */
1919public class PGsparsevec extends PGobject implements PGBinaryObject , Serializable , Cloneable {
2020 private int dimensions ;
@@ -29,7 +29,7 @@ public PGsparsevec() {
2929 }
3030
3131 /**
32- * Creates a sparse vector from an array
32+ * Creates a sparse vector from an array.
3333 *
3434 * @param v float array
3535 */
@@ -58,7 +58,7 @@ public PGsparsevec(float[] v) {
5858 }
5959
6060 /**
61- * Creates a sparse vector from a list
61+ * Creates a sparse vector from a list.
6262 *
6363 * @param <T> number
6464 * @param v list of numbers
@@ -95,9 +95,9 @@ public <T extends Number> PGsparsevec(List<T> v) {
9595 }
9696
9797 /**
98- * Creates a sparse vector from a map of non-zero elements
98+ * Creates a sparse vector from a map of non-zero elements.
9999 * <p>
100- * Indices start at 0
100+ * Indices start at 0.
101101 *
102102 * @param <T> number
103103 * @param map map of non-zero elements
@@ -128,7 +128,7 @@ public <T extends Number> PGsparsevec(Map<Integer, T> map, int dimensions) {
128128 }
129129
130130 /**
131- * Creates a sparse vector from a text representation
131+ * Creates a sparse vector from a text representation.
132132 *
133133 * @param s text representation of a sparse vector
134134 * @throws SQLException exception
@@ -139,7 +139,7 @@ public PGsparsevec(String s) throws SQLException {
139139 }
140140
141141 /**
142- * Sets the value from a text representation of a sparse vector
142+ * Sets the value from a text representation of a sparse vector.
143143 */
144144 public void setValue (String s ) throws SQLException {
145145 if (s == null ) {
@@ -162,7 +162,7 @@ public void setValue(String s) throws SQLException {
162162 }
163163
164164 /**
165- * Returns the text representation of a sparse vector
165+ * Returns the text representation of a sparse vector.
166166 */
167167 public String getValue () {
168168 if (indices == null ) {
@@ -188,14 +188,14 @@ public String getValue() {
188188 }
189189
190190 /**
191- * Returns the number of bytes for the binary representation
191+ * Returns the number of bytes for the binary representation.
192192 */
193193 public int lengthInBytes () {
194194 return indices == null ? 0 : 12 + indices .length * 4 + values .length * 4 ;
195195 }
196196
197197 /**
198- * Sets the value from a binary representation of a sparse vector
198+ * Sets the value from a binary representation of a sparse vector.
199199 */
200200 public void setByteValue (byte [] value , int offset ) throws SQLException {
201201 dimensions = ByteConverter .int4 (value , offset );
@@ -218,7 +218,7 @@ public void setByteValue(byte[] value, int offset) throws SQLException {
218218 }
219219
220220 /**
221- * Writes the binary representation of a sparse vector
221+ * Writes the binary representation of a sparse vector.
222222 */
223223 public void toBytes (byte [] bytes , int offset ) {
224224 if (indices == null ) {
@@ -239,7 +239,7 @@ public void toBytes(byte[] bytes, int offset) {
239239 }
240240
241241 /**
242- * Returns an array
242+ * Returns an array.
243243 *
244244 * @return an array
245245 */
@@ -256,7 +256,7 @@ public float[] toArray() {
256256 }
257257
258258 /**
259- * Returns the number of dimensions
259+ * Returns the number of dimensions.
260260 *
261261 * @return the number of dimensions
262262 */
@@ -265,7 +265,7 @@ public int getDimensions() {
265265 }
266266
267267 /**
268- * Returns the non-zero indices
268+ * Returns the non-zero indices.
269269 *
270270 * @return the non-zero indices
271271 */
@@ -274,7 +274,7 @@ public int[] getIndices() {
274274 }
275275
276276 /**
277- * Returns the non-zero values
277+ * Returns the non-zero values.
278278 *
279279 * @return the non-zero values
280280 */
0 commit comments