All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.anysoft.rrm.RRModelManager Maven / Gradle / Ivy

There is a newer version: 1.6.17
Show newest version
package com.anysoft.rrm;

import java.util.Collection;
import java.util.Hashtable;

import com.anysoft.util.Properties;

/**
 * 管理器
 * @author duanyy
 * @version 1.6.4.14 [20151126 duanyy] 
* - 增加list方法.
*/ public class RRModelManager { private Hashtable> rrms = new Hashtable>(); public RRModel getModel(String id){ return (RRModel) rrms.get(id); } public RRModel addModel(String id,Class clazz,Properties p){ RRModel newModel = new RRModel(id); newModel.configure(p); rrms.put(id, newModel); return newModel; } public RRModel addModel(String id,data instance,Properties p){ RRModel newModel = new RRModel(id); newModel.configure(p); newModel.update(System.currentTimeMillis(), instance); rrms.put(id, newModel); return newModel; } public RRModel addModel(String id,RRModel newModel){ rrms.put(id, newModel); return newModel; } public void remove(String id){ rrms.remove(id); } public void clear(){ rrms.clear(); } public Collection> list(){ return rrms.values(); } protected static RRModelManager instance = new RRModelManager(); public static synchronized RRModelManager get(){ return instance; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy