📄 companysizecode.java
字号:
/* CRMS, customer relationship management systemCopyright (C) 2003 Service To Youth Council This program is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2 of the License, or(at your option) any later version. This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details. You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For further information contact the SYC ICT department on GPL@syc.net.au98 Kermode StreetNorth AdelaideSouth AustraliaSA 5006 +61 (0)8 8367 0755*//* * CompanySizeCode.java * * Created on 19 Oct 2003 */package crms.util;import java.lang.reflect.*;/** * @author lubo * */public class CompanySizeCode extends crms.util.AbstractCode { public static final CompanySizeCode SMALL = new CompanySizeCode("SML", "Small"); public static final CompanySizeCode MEDIUM = new CompanySizeCode("MED", "Medium"); public static final CompanySizeCode LARGE = new CompanySizeCode("LRG", "Large"); public static final CompanySizeCode CORPORATE = new CompanySizeCode("CORP", "Corporate"); public static final CompanySizeCode GOVERMENT = new CompanySizeCode("GOV", "Goverment"); public CompanySizeCode() { } /** Creates a new instance of CompanySizeCode */ public CompanySizeCode(String code, String name) { super(code, name); } public static CompanySizeCode getForCode(String code) { Class clazz = CompanySizeCode.class; Field[] fields = clazz.getDeclaredFields(); try { for (int i=0; i < fields.length; i++) { Field f = fields[i]; if (Modifier.isPublic(f.getModifiers()) && AbstractCode.class.isAssignableFrom(f.getDeclaringClass())) { CompanySizeCode fieldCode = (CompanySizeCode) f.get(null); if (code.trim().equals(fieldCode.getCode())) return fieldCode; } } } catch (Exception ex) { } return null; }/* public static CompanySizeCode getForCode(String code) { if (code.trim().equals(SMALL.getCode())) { return SMALL; } else if (code.trim().equals(MEDIUM.getCode())) { return MEDIUM; } else if (code.trim().equals(LARGE.getCode())) { return LARGE; } else if (code.trim().equals(GOVERMENT.getCode())) { return GOVERMENT; } else if (code.trim().equals(CORPORATE.getCode())) { return CORPORATE; /* } else if (code.trim().equals(SCHOOL.getCode())) { return SCHOOL; } else if (code.trim().equals(OTHER.getCode())) { return OTHER; } return null; } */}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -