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

org.openlca.git.util.ModelRefMap Maven / Gradle / Ivy

There is a newer version: 2.2.1
Show newest version
package org.openlca.git.util;

import org.openlca.git.model.ModelRef;

public class ModelRefMap extends TypedRefIdMap {

	public ModelRefMap put(ModelRef ref, T value) {
		if (ref.isCategory) {
			put(ref.type, ref.path, value);
		} else {
			put(ref.type, ref.refId, value);
		}
		return this;
	}

	public boolean contains(ModelRef ref) {
		if (ref.isCategory)
			return contains(ref.type, ref.path);
		return contains(ref.type, ref.refId);
	}

	public T get(ModelRef ref) {
		if (ref.isCategory)
			return get(ref.type, ref.path);
		return get(ref.type, ref.refId);
	}

	public T remove(ModelRef ref) {
		if (ref.isCategory)
			return remove(ref.type, ref.path);
		return remove(ref.type, ref.refId);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy