package org.arsenal.framework.context;

import java.io.Serializable;
import java.util.Collection;
import java.util.Iterator;
import java.util.Set;

import org.arsenal.framework.core.ExistdException;
import org.arsenal.framework.core.NotExistStateException;

/**
 * 数据访问器
 * 
 * */
public interface Accessor<K, T> extends Identity<String>, Serializable {

	void put(K key, T value) throws ExistdException;

	// 强制放入，如果存在，则替换
	void forePut(K key, T value);

	T load(K name) throws NotExistStateException;

	T get(K name);

	Set<K> keySet();

	Collection<T> values();

	void remove(K name);

	/**
	 * 是否包含 name
	 * 
	 * */
	boolean contains(K name);

	AppObject getObject();

	/** 是否为空 */
	boolean isEmpty();

	/** 清空数据 */
	void clear();

	int size();

	Iterator<K> keyIterator();

	void join(Accessor<K, ?> accessor);
	
	

}
