dictdatacache.java

来自「这是一个轻便的j2ee的web应用框架,是一个在多个项目中运用的实际框架,采用s」· Java 代码 · 共 53 行

JAVA
53
字号
/*
 * Created on 2004-3-25
 *
 */
package com.esimple.service.dict;

import java.util.*;

/**
 * @author steven
 *
 */
public class DictDataCache {
	private HashMap dictType = new HashMap();
	private HashMap dictContent = new  HashMap();
	
	public String getDictType(String typeID){
		if( typeID == null  )return null;
		return dictType.get(typeID).toString();
	}
	
	public HashMap getDictContent(String typeID){
		if( typeID == null  )return null;
		return (HashMap)dictContent.get(typeID);
	}	
	
	public String getDictContent(String typeID,String contentID){
		if( typeID == null ||contentID ==null )return null;
		Object content = dictContent.get(typeID);
		if( content == null ) return null;
		return ((HashMap)content).get(contentID).toString();
	}	
		
	public void addDictType(String typeID,String typeName){
		if( typeID != null && typeName != null )
			dictType.put(typeID,typeName);
	}
	
	public void addDictContent(String typeID, String contentID,String contentName){
		if( typeID == null || contentID == null || contentName == null  ) return;
		if( dictType.get(typeID) == null )return;
		if( dictContent.get(typeID) == null ){
			dictContent.put(typeID,new HashMap());
		}
		((HashMap)dictContent.get(typeID)).put(contentID,contentName);
	}
	
	public void clear(){
		dictType = new HashMap();
		dictContent = new  HashMap();		
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?