Skip to content

Commit 9a2a398

Browse files
author
chengyitian
committed
AJ-790: modify rows for BasicIotAnyVector;
1 parent b3067a8 commit 9a2a398

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/com/xxdb/data/BasicIotAnyVector.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ protected BasicIotAnyVector(ExtendedDataInput in) throws IOException {
7171
}
7272

7373
public Entity get(int index) {
74-
if (index >= indexs.rows())
75-
throw new RuntimeException(String.format("index %s out of %s.", index, indexs.rows()));
74+
if (index >=rows())
75+
throw new RuntimeException(String.format("index %s out of rows %s.", index, rows()));
7676

7777
BasicInt curDataType = (BasicInt) indexsDataType.get(index);
7878
BasicInt curIndex = (BasicInt) indexs.get(index);
@@ -119,7 +119,7 @@ public DATA_TYPE getDataType() {
119119

120120
@Override
121121
public int rows() {
122-
return subVector.size() + 1;
122+
return indexs.rows();
123123
}
124124

125125
@JsonIgnore
@@ -144,7 +144,7 @@ public void Append(Vector value) {
144144

145145
public String getString(){
146146
StringBuilder sb = new StringBuilder("[");
147-
for (int i = 0; i < indexs.rows(); i++)
147+
for (int i = 0; i < rows(); i++)
148148
sb.append(getString(i)).append(",");
149149

150150
sb.setLength(sb.length() - 1);
@@ -169,13 +169,13 @@ public int serialize(int indexStart, int offect, int targetNumElement, AbstractV
169169

170170
@Override
171171
protected void writeVectorToOutputStream(ExtendedDataOutput out) throws IOException {
172-
int[] tmpIntArray = new int[indexs.rows() * 2 + 2];
172+
int[] tmpIntArray = new int[rows() * 2 + 2];
173173

174-
tmpIntArray[0] = indexs.rows();
174+
tmpIntArray[0] = rows();
175175
tmpIntArray[1] = subVector.size();
176176

177-
System.arraycopy(indexs.getdataArray(), 0, tmpIntArray,2, indexs.rows());
178-
System.arraycopy(indexsDataType.getdataArray(), 0, tmpIntArray, indexs.rows() + 2, indexsDataType.size);
177+
System.arraycopy(indexs.getdataArray(), 0, tmpIntArray,2, rows());
178+
System.arraycopy(indexsDataType.getdataArray(), 0, tmpIntArray, rows() + 2, indexsDataType.size);
179179
BasicIntVector intVector = new BasicIntVector(tmpIntArray);
180180

181181
Entity[] entities = new Entity[1 + subVector.size()];

0 commit comments

Comments
 (0)