示例#1
0
 /**
  * Add a vertex to the underlying graph and return it as a framed vertex.
  *
  * @param id the id of the newly created vertex
  * @param kind the default annotated interface to frame the vertex as
  * @param <F> the default type of the annotated interface
  * @return a proxy object backed by the vertex and interpreted from the perspective of the
  *     annotate interface
  */
 public <F> F addVertex(final Object id, final Class<F> kind) {
   Vertex vertex = addVertex(id);
   for (FrameInitializer initializer : config.getFrameInitializers()) {
     initializer.initElement(kind, this, vertex);
   }
   return this.frame(vertex, kind);
 }
示例#2
0
 /**
  * Add an edge to the underlying graph and return it as a framed edge.
  *
  * @param id the id of the newly created edge
  * @param outVertex the outgoing vertex
  * @param inVertex the incoming vertex
  * @param label the label of the edge
  * @param direction the direction of the edge
  * @param kind the default annotated interface to frame the edge as
  * @param <F> the default type of the annotated interface
  * @return a proxy object backed by the edge and interpreted from the perspective of the annotate
  *     interface
  */
 public <F> F addEdge(
     final Object id,
     final Vertex outVertex,
     final Vertex inVertex,
     final String label,
     final Direction direction,
     final Class<F> kind) {
   Edge edge = addEdge(id, outVertex, inVertex, label);
   for (FrameInitializer initializer : config.getFrameInitializers()) {
     initializer.initElement(kind, this, edge);
   }
   return this.frame(edge, direction, kind);
 }