keyword.java
来自「用JAVA实现的miniSQL」· Java 代码 · 共 34 行
JAVA
34 行
public class Keyword {
int type;
String skey;
int ikey;
float fkey;
public Keyword(String key) {
type = 3;
this.skey = key;
}
public Keyword(int key){
type = 1;
this.ikey = key;
}
public Keyword(float key){
type = 2;
this.fkey = key;
}
public int compareTo(Keyword key1){
if(type == 1)
return this.ikey-key1.ikey;
else if(type == 2)
return (int)(this.fkey-key1.fkey);
else
return skey.compareTo(key1.skey);
}
public int length(){
if(type == 1)
return 4;
else if(type == 2)
return 4;
else
return skey.length()*2;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?