constructorarguments.java.svn-base

来自「EasyJWeb是基于java技术」· SVN-BASE 代码 · 共 48 行

SVN-BASE
48
字号
package com.easyjf.container;

import java.util.Map;

/**
 * 构造子参数封装
 * 
 * @author 大峡
 * 
 */
public class ConstructorArguments {
	private Map values = new java.util.TreeMap();

	public ConstructorArguments concat(ConstructorArguments other) {
		this.values.putAll(other.getArguments());
		return this;
	}

	/*
	 * 添加参数
	 */
	public void addArgument(ConstructorArgumentValue value) {
		values.put(value.getIndex(), value);
	}

	public void addArgument(Integer index, Object value) {
		addArgument(index, value.getClass(), value);
	}

	public void addArgument(Integer index, Class type, Object value) {
		ConstructorArgumentValue v = new ConstructorArgumentValue(index, type,
				value);
		addArgument(v);
	}

	public Map getArguments() {
		return values;
	}

	public boolean isEmpty() {
		return values.size() > 0;
	}

	public int getArgCount() {
		return values.size();
	}
}

⌨️ 快捷键说明

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