
org.deeplearning4j.graph.vertexfactory.StringVertexFactory Maven / Gradle / Ivy
package org.deeplearning4j.graph.vertexfactory;
import org.deeplearning4j.graph.api.Vertex;
public class StringVertexFactory implements VertexFactory {
private final String format;
public StringVertexFactory(){
this(null);
}
public StringVertexFactory(String format){
this.format = format;
}
@Override
public Vertex create(int vertexIdx) {
if(format != null) return new Vertex<>(vertexIdx,String.format(format,vertexIdx));
else return new Vertex<>(vertexIdx,String.valueOf(vertexIdx));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy