📄 parameterbase.java
字号:
/* * @(#)ParameterBase.java * * Copyright 2003 by SYNTC, All rights reserved. * * This software is the confidential and proprietary information of SYNTC. * ("Confidential Information"). */package cn.com.syntc.common.io;import java.io.Serializable;import java.util.Hashtable;import java.util.Enumeration;import java.lang.Object;import cn.com.syntc.common.io.CommonException; public class ParameterBase{ protected Hashtable roottable = new Hashtable(); public ParameterBase() { } public void setParameters(String category,Object key,Object value){ try{ // At first get target category hashtable // If no create category yet, it create. Hashtable TargetCategory = (Hashtable)roottable.get(category); if(TargetCategory == null){ Hashtable NewCategory = new Hashtable(); roottable.put(category,NewCategory); TargetCategory = (Hashtable)roottable.get(category); // Set any parameter for any category TargetCategory.put(key,value); } else { TargetCategory.put(key,value); } }catch(Exception e){ // error } } public Object getParameters(String category,Object key){ try{ // At first, get target category hashtable // If no exists table, method return null. Hashtable TargetCategory = (Hashtable)roottable.get(category); if(TargetCategory == null){ return null; } else { return TargetCategory.get(key); } }catch(Exception e){ // error return null; } } public void removeParameters(String category,Object key){ try{ Hashtable targetCategory = (Hashtable)roottable.get(category); if(targetCategory == null){ return; } else { targetCategory.remove(key); } }catch(Exception e){ // error } } public void resetParameters(String category,Object key,Object value){ try{ // at first, target key remove. removeParameters(category,key); // and set new value to same key. setParameters(category,key,value); }catch(Exception e){ // error } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -