⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dictionarykey.java

📁 自己封装的数据字典,可以配置要查询的表和字段快速得到结果
💻 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 + -