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

net.cassite.daf4j.util.ConstantMap Maven / Gradle / Ivy

The newest version!
package net.cassite.daf4j.util;

import java.util.LinkedHashMap;

/**
 * 常量映射,将自动生成(自增的整型)到(常量值)的映射
 */
public class ConstantMap extends LinkedHashMap {
    /**
	 * 
	 */
	private static final long serialVersionUID = -160616718543989584L;
	private int count = 0;

    /**
     * 向映射中增加常量值
     *
     * @param o 要加入的常量值
     * @return 该常量值对应的整型
     */
    public int add(Object o) {
        put(++count, o);
        return count;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy