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

com.tinkerpop.frames.structures.FramedVertexIterable Maven / Gradle / Ivy

Go to download

Windup Frames is an extension of the upstream Frames project, with tools to ease debugging and integration within windup.

There is a newer version: 4.0.1.Final
Show newest version
package com.tinkerpop.frames.structures;

import com.tinkerpop.blueprints.Graph;
import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.frames.FramedGraph;

import java.util.Iterator;

/**
 * @author Marko A. Rodriguez (http://markorodriguez.com)
 */
public class FramedVertexIterable implements Iterable {
    protected final Class kind;
    protected final Iterable iterable;
    protected final FramedGraph framedGraph;

    public FramedVertexIterable(final FramedGraph framedGraph, final Iterable iterable, final Class kind) {
        this.framedGraph = framedGraph;
        this.iterable = iterable;
        this.kind = kind;
    }

    public Iterator iterator() {
        return new Iterator() {
            private Iterator iterator = iterable.iterator();

            public void remove() {
                throw new UnsupportedOperationException();
            }

            public boolean hasNext() {
                return this.iterator.hasNext();
            }

            public T next() {
                return framedGraph.frame(this.iterator.next(), kind);
            }
        };
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy