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

org.securegraph.Path Maven / Gradle / Ivy

The newest version!
package org.securegraph;

import org.securegraph.util.ArrayIterable;

import java.util.Arrays;
import java.util.Iterator;

public class Path implements Iterable {
    private final String[] vertexIds;

    public Path(String... vertexIds) {
        this.vertexIds = vertexIds;
    }

    public Path(Path path, String vertexId) {
        this.vertexIds = Arrays.copyOf(path.vertexIds, path.vertexIds.length + 1);
        this.vertexIds[this.vertexIds.length - 1] = vertexId;
    }

    public int length() {
        return this.vertexIds.length;
    }

    public String get(int i) {
        return this.vertexIds[i];
    }

    @Override
    public Iterator iterator() {
        return new ArrayIterable(this.vertexIds).iterator();
    }

    @Override
    public String toString() {
        return Arrays.toString(vertexIds);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy