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

org.jbpt.algo.tree.tctree.VertexFactory Maven / Gradle / Ivy

package org.jbpt.algo.tree.tctree;

import org.jbpt.hypergraph.abs.IVertex;


public class VertexFactory {
	
	private final Class clazz;
	
	public VertexFactory(Class clazz) {
		this.clazz = clazz;
	}
	
	@SuppressWarnings("unchecked")
	public V createInstance() {
		try {
			return (V) clazz.newInstance();
		} catch (InstantiationException e) {
			e.printStackTrace();
			return null;
		} catch (IllegalAccessException e) {
			e.printStackTrace();
			return null;
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy