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

com.tinkerpop.frames.structures.FramedEdgeIterable 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 java.util.Iterator;

import com.tinkerpop.blueprints.Direction;
import com.tinkerpop.blueprints.Edge;
import com.tinkerpop.blueprints.Graph;
import com.tinkerpop.frames.FramedGraph;
import com.tinkerpop.frames.InVertex;

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

    /**
	 * @deprecated Use {@link #FramedEdgeIterable(FramedGraph, Iterable, Class)}, in combination with {@link InVertex} and {@link OutVertex}.
	 */
    public FramedEdgeIterable(final FramedGraph framedGraph, final Iterable iterable, final Direction direction, final Class kind) {
        this.framedGraph = framedGraph;
        this.iterable = iterable;
        this.kind = kind;
        this.direction = direction;
    }
    
    public FramedEdgeIterable(final FramedGraph framedGraph, final Iterable iterable, final Class kind) {
        this.framedGraph = framedGraph;
        this.iterable = iterable;
        this.kind = kind;
        this.direction = Direction.OUT;
    }

    public Iterator iterator() {
        return new Iterator() {

            private final 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(), direction, kind);
            }
        };
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy