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

org.deeplearning4j.graph.vertexfactory.StringVertexFactory Maven / Gradle / Ivy

There is a newer version: 1.0.0-M2.1
Show newest version
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