?? dictionarykey.java
字號:
package com.gisinfo.Dictionary;
/**
* Author: Jimmy lin
* Date: Nov 10, 2003
* Time: 10:17:57 PM
*/
/**
* This class represents fields of one dictionary which has same tablename
*/
public class DictionaryKey {
protected String tableName= "";
public DictionaryKey() {
}
public DictionaryKey(String tableName) {
this.tableName = tableName;
}
static public boolean stringCompareIgnoreCase(String a, String b){
if (a == null ) {
if (b == null)
return true;
else
return false;
}
else{
if (b == null)
return false;
else
// return a.equals(b);
return a.equalsIgnoreCase(b);
}
}
static public boolean stringCompare(String a,String b){
if (a == null ) {
if (b == null)
return true;
else
return false;
}
else{
if (b == null)
return false;
else
return a.equals(b);
}
}
public boolean equals(Object obj){
if (obj instanceof DictionaryKey) {
DictionaryKey key = (DictionaryKey)obj;
//we use ignore case method here
return stringCompareIgnoreCase(key.getTableName() ,this.tableName );
}
return false;
}
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
public int hashCode() {
// return this.tableName == null ? 0 : this.tableName .charAt(this.tableName .length() -1);//會出現錯誤,因為大小寫在這里的ascii是不同的
return tableName.length();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -