Class AbstractVertexFrame

java.lang.Object
com.syncleus.ferma.AbstractElementFrame
com.syncleus.ferma.AbstractVertexFrame
All Implemented Interfaces:
ElementFrame, VertexFrame
Direct Known Subclasses:
TVertex

public abstract class AbstractVertexFrame
extends AbstractElementFrame
implements VertexFrame
The base class that all vertex frames must extend.
  • Constructor Details

  • Method Details

    • getElement

      public org.apache.tinkerpop.gremlin.structure.Vertex getElement()
      Specified by:
      getElement in interface ElementFrame
      Specified by:
      getElement in interface VertexFrame
      Overrides:
      getElement in class AbstractElementFrame
      Returns:
      The underlying element.
    • addFramedEdge

      public <T> T addFramedEdge​(String label, VertexFrame inVertex, ClassInitializer<T> initializer)
      Description copied from interface: VertexFrame
      Add an edge using the supplied frame type.
      Specified by:
      addFramedEdge in interface VertexFrame
      Type Parameters:
      T - The type for the framed edge.
      Parameters:
      label - The label for the edge
      inVertex - The vertex to link to.
      initializer - the initializer for the frame which defines its type and may initialize properties
      Returns:
      The new edge.
    • addFramedEdge

      public <T> T addFramedEdge​(String label, VertexFrame inVertex, Class<T> kind)
      Description copied from interface: VertexFrame
      Add an edge using the supplied frame type.
      Specified by:
      addFramedEdge in interface VertexFrame
      Type Parameters:
      T - The type for the framed edge.
      Parameters:
      label - The label for the edge
      inVertex - The vertex to link to.
      kind - The kind of frame.
      Returns:
      The new edge.
    • addFramedEdgeExplicit

      public <T> T addFramedEdgeExplicit​(String label, VertexFrame inVertex, ClassInitializer<T> initializer)
      Description copied from interface: VertexFrame
      Add an edge using the supplied frame type. This will bypass the default type resolution and use the untyped resolver instead. This method is useful for speeding up a look up when type resolution isn't required.
      Specified by:
      addFramedEdgeExplicit in interface VertexFrame
      Type Parameters:
      T - The type for the framed edge.
      Parameters:
      label - The label for the edge
      inVertex - The vertex to link to.
      initializer - the initializer for the frame which defines its type and may initialize properties
      Returns:
      The new edge.
    • addFramedEdgeExplicit

      public <T> T addFramedEdgeExplicit​(String label, VertexFrame inVertex, Class<T> kind)
      Description copied from interface: VertexFrame
      Add an edge using the supplied frame type. This will bypass the default type resolution and use the untyped resolver instead. This method is useful for speeding up a look up when type resolution isn't required.
      Specified by:
      addFramedEdgeExplicit in interface VertexFrame
      Type Parameters:
      T - The type for the framed edge.
      Parameters:
      label - The label for the edge
      inVertex - The vertex to link to.
      kind - The kind of frame.
      Returns:
      The new edge.
    • addFramedEdge

      public TEdge addFramedEdge​(String label, VertexFrame inVertex)
      Description copied from interface: VertexFrame
      Add an edge using a frame type of TEdge.
      Specified by:
      addFramedEdge in interface VertexFrame
      Parameters:
      label - The label for the edge
      inVertex - The vertex to link to.
      Returns:
      The added edge.
    • addFramedEdgeExplicit

      public TEdge addFramedEdgeExplicit​(String label, VertexFrame inVertex)
      Description copied from interface: VertexFrame
      Add an edge using a frame type of TEdge. This will bypass the default type resolution and use the untyped resolver instead. This method is useful for speeding up a look up when type resolution isn't required.
      Specified by:
      addFramedEdgeExplicit in interface VertexFrame
      Parameters:
      label - The label for the edge
      inVertex - The vertex to link to.
      Returns:
      The added edge.
    • linkOut

      public void linkOut​(VertexFrame vertex, String... labels)
      Description copied from interface: VertexFrame
      Create edges from the framed vertex to the supplied vertex with the supplied labels
      Specified by:
      linkOut in interface VertexFrame
      Parameters:
      vertex - The vertex to link to.
      labels - The labels for the edges.
    • linkIn

      public void linkIn​(VertexFrame vertex, String... labels)
      Description copied from interface: VertexFrame
      Create edges from the supplied vertex to the framed vertex with the supplied labels
      Specified by:
      linkIn in interface VertexFrame
      Parameters:
      vertex - The vertex to link from.
      labels - The labels for the edges.
    • linkBoth

      public void linkBoth​(VertexFrame vertex, String... labels)
      Description copied from interface: VertexFrame
      Create edges from the supplied vertex to the framed vertex and vice versa with the supplied labels
      Specified by:
      linkBoth in interface VertexFrame
      Parameters:
      vertex - The vertex to link to and from.
      labels - The labels for the edges.
    • unlinkOut

      public void unlinkOut​(VertexFrame vertex, String... labels)
      Description copied from interface: VertexFrame
      Remove all out edges to the supplied vertex with the supplied labels.
      Specified by:
      unlinkOut in interface VertexFrame
      Parameters:
      vertex - The vertex to removed the edges to.
      labels - The labels of the edges.
    • unlinkIn

      public void unlinkIn​(VertexFrame vertex, String... labels)
      Description copied from interface: VertexFrame
      Remove all in edges to the supplied vertex with the supplied labels.
      Specified by:
      unlinkIn in interface VertexFrame
      Parameters:
      vertex - The vertex to removed the edges from.
      labels - The labels of the edges.
    • unlinkBoth

      public void unlinkBoth​(VertexFrame vertex, String... labels)
      Description copied from interface: VertexFrame
      Remove all edges to/from the supplied vertex with the supplied labels.
      Specified by:
      unlinkBoth in interface VertexFrame
      Parameters:
      vertex - The vertex to removed the edges to/from.
      labels - The labels of the edges.
    • setLinkOut

      public void setLinkOut​(VertexFrame vertex, String... labels)
      Description copied from interface: VertexFrame
      Remove all out edges with the labels and then add a single edge to the supplied vertex.
      Specified by:
      setLinkOut in interface VertexFrame
      Parameters:
      vertex - the vertex to link to.
      labels - The labels of the edges.
    • setLinkIn

      public void setLinkIn​(VertexFrame vertex, String... labels)
      Description copied from interface: VertexFrame
      Remove all in edges with the labels and then add a single edge from the supplied vertex.
      Specified by:
      setLinkIn in interface VertexFrame
      Parameters:
      vertex - the vertex to link from.
      labels - The labels of the edges.
    • setLinkBoth

      public void setLinkBoth​(VertexFrame vertex, String... labels)
      Description copied from interface: VertexFrame
      Remove all edges with the labels and then add a edges from the supplied vertex and to the supplied vertex.
      Specified by:
      setLinkBoth in interface VertexFrame
      Parameters:
      vertex - the vertex to link from.
      labels - The labels of the edges.
    • setLinkOut

      public <K> K setLinkOut​(ClassInitializer<K> initializer, String... labels)
      Description copied from interface: VertexFrame
      Remove all out edges with the labels and then add a single edge to a new vertex.
      Specified by:
      setLinkOut in interface VertexFrame
      Type Parameters:
      K - The type used to frame the edge.
      Parameters:
      initializer - the initializer for the frame which defines its type and may initialize properties
      labels - The labels of the edges.
      Returns:
      The newly created edge.
    • setLinkOut

      public <K> K setLinkOut​(Class<K> kind, String... labels)
      Description copied from interface: VertexFrame
      Remove all out edges with the labels and then add a single edge to a new vertex.
      Specified by:
      setLinkOut in interface VertexFrame
      Type Parameters:
      K - The type used to frame the edge.
      Parameters:
      kind - The kind of frame.
      labels - The labels of the edges.
      Returns:
      The newly created edge.
    • setLinkOutExplicit

      public <K> K setLinkOutExplicit​(ClassInitializer<K> initializer, String... labels)
      Description copied from interface: VertexFrame
      Remove all out edges with the labels and then add a single edge to a new vertex. This will bypass the default type resolution and use the untyped resolver instead. This method is useful for speeding up a look up when type resolution isn't required.
      Specified by:
      setLinkOutExplicit in interface VertexFrame
      Type Parameters:
      K - The type used to frame the edge.
      Parameters:
      initializer - the initializer for the frame which defines its type and may initialize properties
      labels - The labels of the edges.
      Returns:
      The newly created edge.
    • setLinkOutExplicit

      public <K> K setLinkOutExplicit​(Class<K> kind, String... labels)
      Description copied from interface: VertexFrame
      Remove all out edges with the labels and then add a single edge to a new vertex. This will bypass the default type resolution and use the untyped resolver instead. This method is useful for speeding up a look up when type resolution isn't required.
      Specified by:
      setLinkOutExplicit in interface VertexFrame
      Type Parameters:
      K - The type used to frame the edge.
      Parameters:
      kind - The kind of frame.
      labels - The labels of the edges.
      Returns:
      The newly created edge.
    • setLinkIn

      public <K> K setLinkIn​(ClassInitializer<K> initializer, String... labels)
      Description copied from interface: VertexFrame
      Remove all in edges with the labels and then add a single edge from a new vertex.
      Specified by:
      setLinkIn in interface VertexFrame
      Type Parameters:
      K - The type used to frame the edge.
      Parameters:
      initializer - the initializer for the frame which defines its type and may initialize properties
      labels - The labels of the edges.
      Returns:
      The newly created edge.
    • setLinkIn

      public <K> K setLinkIn​(Class<K> kind, String... labels)
      Description copied from interface: VertexFrame
      Remove all in edges with the labels and then add a single edge from a new vertex.
      Specified by:
      setLinkIn in interface VertexFrame
      Type Parameters:
      K - The type used to frame the edge.
      Parameters:
      kind - The kind of frame.
      labels - The labels of the edges.
      Returns:
      The newly created edge.
    • setLinkInExplicit

      public <K> K setLinkInExplicit​(ClassInitializer<K> initializer, String... labels)
      Description copied from interface: VertexFrame
      Remove all in edges with the labels and then add a single edge from a new vertex. This will bypass the default type resolution and use the untyped resolver instead. This method is useful for speeding up a look up when type resolution isn't required.
      Specified by:
      setLinkInExplicit in interface VertexFrame
      Type Parameters:
      K - The type used to frame the edge.
      Parameters:
      initializer - the initializer for the frame which defines its type and may initialize properties
      labels - The labels of the edges.
      Returns:
      The newly created edge.
    • setLinkInExplicit

      public <K> K setLinkInExplicit​(Class<K> kind, String... labels)
      Description copied from interface: VertexFrame
      Remove all in edges with the labels and then add a single edge from a new vertex. This will bypass the default type resolution and use the untyped resolver instead. This method is useful for speeding up a look up when type resolution isn't required.
      Specified by:
      setLinkInExplicit in interface VertexFrame
      Type Parameters:
      K - The type used to frame the edge.
      Parameters:
      kind - The kind of frame.
      labels - The labels of the edges.
      Returns:
      The newly created edge.
    • setLinkBoth

      public <K> K setLinkBoth​(ClassInitializer<K> initializer, String... labels)
      Description copied from interface: VertexFrame
      Remove all edges with the labels and then add edges to/from a new vertex.
      Specified by:
      setLinkBoth in interface VertexFrame
      Type Parameters:
      K - The type used to frame the edge.
      Parameters:
      initializer - the initializer for the frame which defines its type and may initialize properties
      labels - The labels of the edges.
      Returns:
      The newly created edge.
    • setLinkBoth

      public <K> K setLinkBoth​(Class<K> kind, String... labels)
      Description copied from interface: VertexFrame
      Remove all edges with the labels and then add edges to/from a new vertex.
      Specified by:
      setLinkBoth in interface VertexFrame
      Type Parameters:
      K - The type used to frame the edge.
      Parameters:
      kind - The kind of frame.
      labels - The labels of the edges.
      Returns:
      The newly created edge.
    • setLinkBothExplicit

      public <K> K setLinkBothExplicit​(ClassInitializer<K> initializer, String... labels)
      Description copied from interface: VertexFrame
      Remove all edges with the labels and then add edges to/from a new vertex. This will bypass the default type resolution and use the untyped resolver instead. This method is useful for speeding up a look up when type resolution isn't required.
      Specified by:
      setLinkBothExplicit in interface VertexFrame
      Type Parameters:
      K - The type used to frame the edge.
      Parameters:
      initializer - the initializer for the frame which defines its type and may initialize properties
      labels - The labels of the edges.
      Returns:
      The newly created edge.
    • setLinkBothExplicit

      public <K> K setLinkBothExplicit​(Class<K> kind, String... labels)
      Description copied from interface: VertexFrame
      Remove all edges with the labels and then add edges to/from a new vertex. This will bypass the default type resolution and use the untyped resolver instead. This method is useful for speeding up a look up when type resolution isn't required.
      Specified by:
      setLinkBothExplicit in interface VertexFrame
      Type Parameters:
      K - The type used to frame the edge.
      Parameters:
      kind - The kind of frame.
      labels - The labels of the edges.
      Returns:
      The newly created edge.
    • toJson

      public com.google.gson.JsonObject toJson()
      Description copied from interface: VertexFrame
      Output the vertex as JSON.
      Specified by:
      toJson in interface VertexFrame
      Returns:
      A JsonObject representing this frame.
    • toString

      public String toString()
      Overrides:
      toString in class AbstractElementFrame
    • reframe

      public <T> T reframe​(Class<T> kind)
      Description copied from interface: VertexFrame
      Reframe this element as a different type of frame.
      Specified by:
      reframe in interface VertexFrame
      Type Parameters:
      T - The type used to frame the element.
      Parameters:
      kind - The new kind of frame.
      Returns:
      The new frame
    • reframeExplicit

      public <T> T reframeExplicit​(Class<T> kind)
      Description copied from interface: VertexFrame
      Reframe this element as a different type of frame. This will bypass the default type resolution and use the untyped resolver instead. This method is useful for speeding up a look up when type resolution isn't required.
      Specified by:
      reframeExplicit in interface VertexFrame
      Type Parameters:
      T - The type used to frame the element.
      Parameters:
      kind - The new kind of frame.
      Returns:
      The new frame
    • traverse

      public <T extends Traversable<?,​ ?>> T traverse​(Function<org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal<org.apache.tinkerpop.gremlin.structure.Vertex,​org.apache.tinkerpop.gremlin.structure.Vertex>,​org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal<?,​?>> traverser)
      Specified by:
      traverse in interface VertexFrame
    • getRawTraversal

      public org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal<? extends org.apache.tinkerpop.gremlin.structure.Vertex,​? extends org.apache.tinkerpop.gremlin.structure.Vertex> getRawTraversal()
      Specified by:
      getRawTraversal in interface VertexFrame