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

com.alogic.xscript.util.MapProperties Maven / Gradle / Ivy

There is a newer version: 1.6.17
Show newest version
package com.alogic.xscript.util;

import java.util.Map;

import com.anysoft.util.Properties;

/**
 * 基于Map的Properties
 * 
 * @author duanyy
 *
 */
public class MapProperties extends Properties{

	protected Map map = null;
	
	public MapProperties(Map map,Properties parent){
		super("default",parent);
		
		this.map = map;
	}
	
	@Override
	protected void _SetValue(String _name, String _value) {
		if (map != null){
			map.put(_name, _value);
		}
	}

	@Override
	protected String _GetValue(String _name) {
		if (map != null){
			Object found = map.get(_name);
			return found == null? null : found.toString();
		}
		return null;
	}

	@Override
	public void Clear() {
		if (map != null){
			map.clear();
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy