View Javadoc
1   /*
2    * Copyright 2021 TiKV Project Authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   *
16   */
17  
18  package org.tikv.common.row;
19  
20  import java.io.Serializable;
21  import java.sql.Date;
22  import java.sql.Time;
23  import java.sql.Timestamp;
24  import org.tikv.common.types.DataType;
25  
26  /**
27   * Even in case of mem-buffer-based row we can ignore field types when en/decoding if we put some
28   * padding bits for fixed length and use fixed length index for var-length
29   */
30  public interface Row extends Serializable {
31    void setNull(int pos);
32  
33    boolean isNull(int pos);
34  
35    void setFloat(int pos, float v);
36  
37    float getFloat(int pos);
38  
39    void setDouble(int pos, double v);
40  
41    double getDouble(int pos);
42  
43    void setInteger(int pos, int v);
44  
45    int getInteger(int pos);
46  
47    void setShort(int pos, short v);
48  
49    short getShort(int pos);
50  
51    void setLong(int pos, long v);
52  
53    long getLong(int pos);
54  
55    long getUnsignedLong(int pos);
56  
57    void setString(int pos, String v);
58  
59    String getString(int pos);
60  
61    void setTime(int pos, Time v);
62  
63    Date getTime(int pos);
64  
65    void setTimestamp(int pos, Timestamp v);
66  
67    Timestamp getTimestamp(int pos);
68  
69    void setDate(int pos, Date v);
70  
71    Date getDate(int pos);
72  
73    void setBytes(int pos, byte[] v);
74  
75    byte[] getBytes(int pos);
76  
77    void set(int pos, DataType type, Object v);
78  
79    Object get(int pos, DataType type);
80  
81    int fieldCount();
82  }