Skip to content

Commit 3d5c002

Browse files
committed
Updated doc comments [skip ci]
1 parent a24d61c commit 3d5c002

4 files changed

Lines changed: 48 additions & 48 deletions

File tree

src/main/java/com/pgvector/PGbit.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import org.postgresql.util.PGobject;
1313

1414
/**
15-
* PGbit class
15+
* A bit string.
1616
*/
1717
public class PGbit extends PGobject implements PGBinaryObject, Serializable, Cloneable {
1818
private int length;
@@ -26,7 +26,7 @@ public PGbit() {
2626
}
2727

2828
/**
29-
* Creates a bit string from a boolean array
29+
* Creates a bit string from a boolean array.
3030
*
3131
* @param v boolean array
3232
*/
@@ -40,7 +40,7 @@ public PGbit(boolean[] v) {
4040
}
4141

4242
/**
43-
* Creates a bit string from a byte array
43+
* Creates a bit string from a byte array.
4444
*
4545
* @param v byte array
4646
*/
@@ -51,7 +51,7 @@ public PGbit(byte[] v) {
5151
}
5252

5353
/**
54-
* Creates a bit string from a text representation
54+
* Creates a bit string from a text representation.
5555
*
5656
* @param s text representation of a bit string
5757
* @throws SQLException exception
@@ -62,7 +62,7 @@ public PGbit(String s) throws SQLException {
6262
}
6363

6464
/**
65-
* Sets the value from a text representation of a bit string
65+
* Sets the value from a text representation of a bit string.
6666
*/
6767
public void setValue(String s) throws SQLException {
6868
if (s == null) {
@@ -77,7 +77,7 @@ public void setValue(String s) throws SQLException {
7777
}
7878

7979
/**
80-
* Returns the text representation of a bit string
80+
* Returns the text representation of a bit string.
8181
*/
8282
public String getValue() {
8383
if (data == null) {
@@ -92,14 +92,14 @@ public String getValue() {
9292
}
9393

9494
/**
95-
* Returns the number of bytes for the binary representation
95+
* Returns the number of bytes for the binary representation.
9696
*/
9797
public int lengthInBytes() {
9898
return data == null ? 0 : 4 + data.length;
9999
}
100100

101101
/**
102-
* Sets the value from a binary representation of a bit string
102+
* Sets the value from a binary representation of a bit string.
103103
*/
104104
public void setByteValue(byte[] value, int offset) throws SQLException {
105105
length = ByteConverter.int4(value, offset);
@@ -110,7 +110,7 @@ public void setByteValue(byte[] value, int offset) throws SQLException {
110110
}
111111

112112
/**
113-
* Writes the binary representation of a bit string
113+
* Writes the binary representation of a bit string.
114114
*/
115115
public void toBytes(byte[] bytes, int offset) {
116116
if (data == null) {
@@ -124,7 +124,7 @@ public void toBytes(byte[] bytes, int offset) {
124124
}
125125

126126
/**
127-
* Returns the length
127+
* Returns the length.
128128
*
129129
* @return an array
130130
*/
@@ -133,7 +133,7 @@ public int length() {
133133
}
134134

135135
/**
136-
* Returns a byte array
136+
* Returns a byte array.
137137
*
138138
* @return an array
139139
*/
@@ -142,7 +142,7 @@ public byte[] toByteArray() {
142142
}
143143

144144
/**
145-
* Returns an array
145+
* Returns an array.
146146
*
147147
* @return an array
148148
*/
@@ -155,7 +155,7 @@ public boolean[] toArray() {
155155
}
156156

157157
/**
158-
* Registers the bit type
158+
* Registers the bit type.
159159
*
160160
* @param conn connection
161161
* @throws SQLException exception

src/main/java/com/pgvector/PGhalfvec.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
import org.postgresql.util.PGobject;
1111

1212
/**
13-
* PGhalfvec class
13+
* A half vector.
1414
*/
1515
public class PGhalfvec extends PGobject implements Serializable, Cloneable {
1616
/*
1717
* Use float and text format for now since Float.float16ToFloat/floatToFloat16
18-
* are not available until Java 20
18+
* are not available until Java 20.
1919
*/
2020
private float[] vec;
2121

@@ -27,7 +27,7 @@ public PGhalfvec() {
2727
}
2828

2929
/**
30-
* Creates a half vector from an array
30+
* Creates a half vector from an array.
3131
*
3232
* @param v float array
3333
*/
@@ -37,7 +37,7 @@ public PGhalfvec(float[] v) {
3737
}
3838

3939
/**
40-
* Creates a half vector from a list
40+
* Creates a half vector from a list.
4141
*
4242
* @param <T> number
4343
* @param v list of numbers
@@ -56,7 +56,7 @@ public <T extends Number> PGhalfvec(List<T> v) {
5656
}
5757

5858
/**
59-
* Creates a half vector from a text representation
59+
* Creates a half vector from a text representation.
6060
*
6161
* @param s text representation of a half vector
6262
* @throws SQLException exception
@@ -67,7 +67,7 @@ public PGhalfvec(String s) throws SQLException {
6767
}
6868

6969
/**
70-
* Sets the value from a text representation of a half vector
70+
* Sets the value from a text representation of a half vector.
7171
*/
7272
public void setValue(String s) throws SQLException {
7373
if (s == null) {
@@ -82,7 +82,7 @@ public void setValue(String s) throws SQLException {
8282
}
8383

8484
/**
85-
* Returns the text representation of a half vector
85+
* Returns the text representation of a half vector.
8686
*/
8787
public String getValue() {
8888
if (vec == null) {
@@ -93,7 +93,7 @@ public String getValue() {
9393
}
9494

9595
/**
96-
* Returns an array
96+
* Returns an array.
9797
*
9898
* @return an array
9999
*/

src/main/java/com/pgvector/PGsparsevec.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import org.postgresql.util.PGobject;
1515

1616
/**
17-
* PGsparsevec class
17+
* A sparse vector.
1818
*/
1919
public 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

Comments
 (0)