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

org.jpmml.model.visitors.PMMLObjectInterner Maven / Gradle / Ivy

There is a newer version: 1.6.6
Show newest version
/*
 * Copyright (c) 2022 Villu Ruusmann
 */
package org.jpmml.model.visitors;

import java.util.Objects;

import org.dmg.pmml.PMMLObject;
import org.jpmml.model.PMMLObjectCache;

abstract
public class PMMLObjectInterner extends ElementInterner {

	private PMMLObjectCache cache = null;


	protected PMMLObjectInterner(Class type, PMMLObjectCache cache){
		super(type);

		setCache(cache);
	}

	@Override
	public E intern(E object){
		PMMLObjectCache cache = getCache();

		return cache.intern(object);
	}

	public PMMLObjectCache getCache(){
		return this.cache;
	}

	private void setCache(PMMLObjectCache cache){
		this.cache = Objects.requireNonNull(cache);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy