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

org.vertexium.cli.model.LazyVertexList Maven / Gradle / Ivy

There is a newer version: 4.10.0
Show newest version
package org.vertexium.cli.model;

import org.vertexium.cli.VertexiumScript;

import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.List;

public class LazyVertexList extends ModelBase {
    private final List vertexIds;

    public LazyVertexList(List vertexIds) {
        this.vertexIds = vertexIds;
    }

    @Override
    public String toString() {
        StringWriter out = new StringWriter();
        PrintWriter writer = new PrintWriter(out);

        VertexiumScript.getContextVertices().clear();
        int vertexIndex = 0;

        writer.println("");
        for (String vertexId : vertexIds) {
            String vertexIndexString = "v" + vertexIndex;
            writer.println("@|bold " + vertexIndexString + ":|@ " + vertexId);
            LazyVertex lazyVertex = new LazyVertex(vertexId);
            VertexiumScript.getContextVertices().put(vertexIndexString, lazyVertex);
            vertexIndex++;
        }

        return out.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy