本文整理汇总了Java中com.syncleus.ferma.VertexFrame类的典型用法代码示例。如果您正苦于以下问题:Java VertexFrame类的具体用法?Java VertexFrame怎么用?Java VertexFrame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VertexFrame类属于com.syncleus.ferma包,在下文中一共展示了VertexFrame类的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: resolve
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@Override
public <T> Class<? extends T> resolve(final Element element, final Class<T> kind) {
final String nodeClazz = element.getProperty(this.typeResolutionKey);
if (nodeClazz == null) {
return kind;
}
final Class<T> nodeKind = (Class<T>) this.reflectionCache.forName(nodeClazz);
if (kind.isAssignableFrom(nodeKind) || kind.equals(VertexFrame.class) || kind.equals(EdgeFrame.class)
|| kind.equals(AbstractVertexFrame.class) || kind.equals(AbstractEdgeFrame.class) || kind.equals(Object.class)) {
return nodeKind;
} else {
return kind;
}
}
开发者ID:gentics,
项目名称:mesh,
代码行数:17,
代码来源:MeshTypeResolver.java
示例2: getVertexes
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@RuntimeType
public static Iterator getVertexes(@This final VertexFrame thiz, @Origin final Method method) {
assert thiz instanceof CachesReflection;
final Adjacency annotation = ((CachesReflection) thiz).getReflectionCache().getAnnotation(method, Adjacency.class);
final Direction direction = annotation.direction();
final String label = annotation.label();
return thiz.traverse(input -> {
switch(direction) {
case IN:
return input.in(label);
case OUT:
return input.out(label);
case BOTH:
return input.both(label);
default:
throw new IllegalStateException("Direction not recognized.");
}
}).frame(VertexFrame.class);
}
开发者ID:Syncleus,
项目名称:Ferma,
代码行数:21,
代码来源:AdjacencyMethodHandler.java
示例3: getVertex
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@RuntimeType
public static Object getVertex(@This final VertexFrame thiz, @Origin final Method method, @RuntimeType @Argument(0) final Class type) {
assert thiz instanceof CachesReflection;
final Adjacency annotation = ((CachesReflection) thiz).getReflectionCache().getAnnotation(method, Adjacency.class);
final Direction direction = annotation.direction();
final String label = annotation.label();
final TypeResolver resolver = thiz.getGraph().getTypeResolver();
return thiz.traverse(input -> {
switch(direction) {
case IN:
return resolver.hasType(input.in(label), type);
case OUT:
return resolver.hasType(input.out(label), type);
case BOTH:
return resolver.hasType(input.both(label), type);
default:
throw new IllegalStateException("Direction not recognized.");
}
}).next(type);
}
开发者ID:Syncleus,
项目名称:Ferma,
代码行数:22,
代码来源:AdjacencyMethodHandler.java
示例4: addVertex
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@RuntimeType
public static Object addVertex(@This final VertexFrame thiz, @Origin final Method method) {
final VertexFrame newVertex = thiz.getGraph().addFramedVertex();
assert thiz instanceof CachesReflection;
final Adjacency annotation = ((CachesReflection) thiz).getReflectionCache().getAnnotation(method, Adjacency.class);
final Direction direction = annotation.direction();
final String label = annotation.label();
switch (direction) {
case BOTH:
thiz.getGraph().addFramedEdge(newVertex, thiz, label);
thiz.getGraph().addFramedEdge(thiz, newVertex, label);
break;
case IN:
thiz.getGraph().addFramedEdge(newVertex, thiz, label);
break;
case OUT:
thiz.getGraph().addFramedEdge(thiz, newVertex, label);
break;
default:
throw new IllegalStateException(method.getName() + " is annotated with a direction other than BOTH, IN, or OUT.");
}
return newVertex;
}
开发者ID:Syncleus,
项目名称:Ferma,
代码行数:26,
代码来源:AdjacencyMethodHandler.java
示例5: resolve
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@Override
public <T> Class<? extends T> resolve(final Element element, final Class<T> kind) {
final Property<String> nodeClazzProperty = element.<String>property(this.typeResolutionKey);
final String nodeClazz;
if( nodeClazzProperty.isPresent() )
nodeClazz = nodeClazzProperty.value();
else
return kind;
final Class<T> nodeKind = (Class<T>) this.reflectionCache.forName(nodeClazz);
if (kind.isAssignableFrom(nodeKind) || kind.equals(VertexFrame.class) || kind.equals(EdgeFrame.class) || kind.equals(AbstractVertexFrame.class) || kind.equals(AbstractEdgeFrame.class) || kind.
equals(Object.class))
return nodeKind;
else
return kind;
}
开发者ID:Syncleus,
项目名称:Ferma,
代码行数:18,
代码来源:PolymorphicTypeResolver.java
示例6: testGetSonEdgesDefault
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@Test
public void testGetSonEdgesDefault() {
final TinkerGraph godGraph = TinkerGraph.open();
GodGraphLoader.load(godGraph);
final FramedGraph framedGraph = new DelegatingFramedGraph(godGraph, TEST_TYPES);
final List<? extends God> gods = framedGraph.traverse(
input -> input.V().has("name", "jupiter")).toList(God.class);
final God father = gods.iterator().next();
Assert.assertTrue(father != null);
final VertexFrame fatherVertex = father;
Assert.assertEquals(fatherVertex.getProperty("name"), "jupiter");
final Iterator<? extends EdgeFrame> childEdgeIterator = father.getSonEdges();
Assert.assertTrue(childEdgeIterator.hasNext());
final EdgeFrame childEdge = childEdgeIterator.next();
Assert.assertEquals(childEdge.getElement().outVertex().property("name").value(), "hercules");
}
开发者ID:Syncleus,
项目名称:Ferma,
代码行数:21,
代码来源:IncidenceMethodHandlerTest.java
示例7: testGetSonEdgesListDefault
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@Test
public void testGetSonEdgesListDefault() {
final TinkerGraph godGraph = TinkerGraph.open();
GodGraphLoader.load(godGraph);
final FramedGraph framedGraph = new DelegatingFramedGraph(godGraph, TEST_TYPES);
final List<? extends God> gods = framedGraph.traverse(
input -> input.V().has("name", "jupiter")).toList(God.class);
final God father = gods.iterator().next();
Assert.assertTrue(father != null);
final VertexFrame fatherVertex = father;
Assert.assertEquals(fatherVertex.getProperty("name"), "jupiter");
final List<? extends EdgeFrame> edgesList = father.getSonEdgesList();
Assert.assertFalse(edgesList.isEmpty());
final EdgeFrame childEdge = edgesList.get(0);
Assert.assertEquals(childEdge.getElement().outVertex().property("name").value(), "hercules");
}
开发者ID:Syncleus,
项目名称:Ferma,
代码行数:21,
代码来源:IncidenceMethodHandlerTest.java
示例8: testGetSonEdgesSetDefault
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@Test
public void testGetSonEdgesSetDefault() {
final TinkerGraph godGraph = TinkerGraph.open();
GodGraphLoader.load(godGraph);
final FramedGraph framedGraph = new DelegatingFramedGraph(godGraph, TEST_TYPES);
final List<? extends God> gods = framedGraph.traverse(
input -> input.V().has("name", "jupiter")).toList(God.class);
final God father = gods.iterator().next();
Assert.assertTrue(father != null);
final VertexFrame fatherVertex = father;
Assert.assertEquals(fatherVertex.getProperty("name"), "jupiter");
final Set<? extends EdgeFrame> sonEdgesSet = father.getSonEdgesSet();
Assert.assertFalse(sonEdgesSet.isEmpty());
final EdgeFrame childEdge = sonEdgesSet.iterator().next();
Assert.assertEquals(childEdge.getElement().outVertex().property("name").value(), "hercules");
}
开发者ID:Syncleus,
项目名称:Ferma,
代码行数:21,
代码来源:IncidenceMethodHandlerTest.java
示例9: testGetSonEdgesByType
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@Test
public void testGetSonEdgesByType() {
final TinkerGraph godGraph = TinkerGraph.open();
GodGraphLoader.load(godGraph);
final FramedGraph framedGraph = new DelegatingFramedGraph(godGraph, TEST_TYPES);
final List<? extends God> gods = framedGraph.traverse(
input -> input.V().has("name", "jupiter")).toList(God.class);
final God father = gods.iterator().next();
Assert.assertTrue(father != null);
final VertexFrame fatherVertex = father;
Assert.assertEquals(fatherVertex.getProperty("name"), "jupiter");
final Iterator<? extends FatherEdge> childEdgeIterator = father.getSonEdges(FatherEdge.class);
Assert.assertTrue(childEdgeIterator.hasNext());
final FatherEdge childEdge = childEdgeIterator.next();
Assert.assertTrue(childEdge != null);
final EdgeFrame edge = childEdge;
Assert.assertEquals(edge.getElement().outVertex().property("name").value(), "hercules");
}
开发者ID:Syncleus,
项目名称:Ferma,
代码行数:23,
代码来源:IncidenceMethodHandlerTest.java
示例10: testGetSonEdgesListByType
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@Test
public void testGetSonEdgesListByType() {
final TinkerGraph godGraph = TinkerGraph.open();
GodGraphLoader.load(godGraph);
final FramedGraph framedGraph = new DelegatingFramedGraph(godGraph, TEST_TYPES);
final List<? extends God> gods = framedGraph.traverse(
input -> input.V().has("name", "jupiter")).toList(God.class);
final God father = gods.iterator().next();
Assert.assertTrue(father != null);
final VertexFrame fatherVertex = father;
Assert.assertEquals(fatherVertex.getProperty("name"), "jupiter");
final List<? extends FatherEdge> childEdges = father.getSonEdgesList(FatherEdge.class);
Assert.assertFalse(childEdges.isEmpty());
final FatherEdge childEdge = childEdges.get(0);
Assert.assertTrue(childEdge != null);
final EdgeFrame edge = childEdge;
Assert.assertEquals(edge.getElement().outVertex().property("name").value(), "hercules");
}
开发者ID:Syncleus,
项目名称:Ferma,
代码行数:23,
代码来源:IncidenceMethodHandlerTest.java
示例11: testGetSonEdgesSetByType
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@Test
public void testGetSonEdgesSetByType() {
final TinkerGraph godGraph = TinkerGraph.open();
GodGraphLoader.load(godGraph);
final FramedGraph framedGraph = new DelegatingFramedGraph(godGraph, TEST_TYPES);
final List<? extends God> gods = framedGraph.traverse(
input -> input.V().has("name", "jupiter")).toList(God.class);
final God father = gods.iterator().next();
Assert.assertTrue(father != null);
final VertexFrame fatherVertex = father;
Assert.assertEquals(fatherVertex.getProperty("name"), "jupiter");
final Set<? extends FatherEdge> childEdges = father.getSonEdgesSet(FatherEdge.class);
Assert.assertFalse(childEdges.isEmpty());
final FatherEdge childEdge = childEdges.iterator().next();
Assert.assertTrue(childEdge != null);
final EdgeFrame edge = childEdge;
Assert.assertEquals(edge.getElement().outVertex().property("name").value(), "hercules");
}
开发者ID:Syncleus,
项目名称:Ferma,
代码行数:23,
代码来源:IncidenceMethodHandlerTest.java
示例12: testObtainSonEdgesByType
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@Test
public void testObtainSonEdgesByType() {
final TinkerGraph godGraph = TinkerGraph.open();
GodGraphLoader.load(godGraph);
final FramedGraph framedGraph = new DelegatingFramedGraph(godGraph, TEST_TYPES);
final List<? extends God> gods = framedGraph.traverse(
input -> input.V().has("name", "jupiter")).toList(God.class);
final God father = gods.iterator().next();
Assert.assertTrue(father != null);
final VertexFrame fatherVertex = father;
Assert.assertEquals(fatherVertex.getProperty("name"), "jupiter");
final Iterator<? extends FatherEdge> childEdgeIterator = father.obtainSonEdges(FatherEdge.class);
Assert.assertTrue(childEdgeIterator.hasNext());
final FatherEdge childEdge = childEdgeIterator.next();
Assert.assertTrue(childEdge != null);
final EdgeFrame edge = childEdge;
Assert.assertEquals(edge.getElement().outVertex().property("name").value(), "hercules");
}
开发者ID:Syncleus,
项目名称:Ferma,
代码行数:23,
代码来源:IncidenceMethodHandlerTest.java
示例13: testGetSonEdgesExtended
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@Test
public void testGetSonEdgesExtended() {
final TinkerGraph godGraph = TinkerGraph.open();
GodGraphLoader.load(godGraph);
final FramedGraph framedGraph = new DelegatingFramedGraph(godGraph, TEST_TYPES);
final List<? extends God> gods = framedGraph.traverse(
input -> input.V().has("name", "jupiter")).toList(God.class);
final God father = gods.iterator().next();
Assert.assertTrue(father != null);
final VertexFrame fatherVertex = father;
Assert.assertEquals(fatherVertex.getProperty("name"), "jupiter");
final Iterator<? extends FatherEdge> childEdgeIterator = father.getSonEdges(FatherEdgeExtended.class);
Assert.assertTrue(childEdgeIterator.hasNext());
final FatherEdge childEdge = childEdgeIterator.next();
Assert.assertTrue(childEdge instanceof FatherEdgeExtended);
Assert.assertTrue(childEdge instanceof EdgeFrame);
final EdgeFrame edge = childEdge;
Assert.assertEquals(edge.getElement().outVertex().property("name").value(), "hercules");
}
开发者ID:Syncleus,
项目名称:Ferma,
代码行数:24,
代码来源:IncidenceMethodHandlerTest.java
示例14: testGetSonEdgeDefault
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@Test
public void testGetSonEdgeDefault() {
final TinkerGraph godGraph = TinkerGraph.open();
GodGraphLoader.load(godGraph);
final FramedGraph framedGraph = new DelegatingFramedGraph(godGraph, TEST_TYPES);
final List<? extends God> gods = framedGraph.traverse(
input -> input.V().has("name", "jupiter")).toList(God.class);
final God father = gods.iterator().next();
Assert.assertTrue(father != null);
final VertexFrame fatherVertex = father;
Assert.assertEquals(fatherVertex.getProperty("name"), "jupiter");
final EdgeFrame childEdge = father.getSonEdge();
Assert.assertEquals(childEdge.getElement().outVertex().property("name").value(), "hercules");
}
开发者ID:Syncleus,
项目名称:Ferma,
代码行数:19,
代码来源:IncidenceMethodHandlerTest.java
示例15: testGetSonEdgeByType
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@Test
public void testGetSonEdgeByType() {
final TinkerGraph godGraph = TinkerGraph.open();
GodGraphLoader.load(godGraph);
final FramedGraph framedGraph = new DelegatingFramedGraph(godGraph, TEST_TYPES);
final List<? extends God> gods = framedGraph.traverse(
input -> input.V().has("name", "jupiter")).toList(God.class);
final God father = gods.iterator().next();
Assert.assertTrue(father != null);
final VertexFrame fatherVertex = father;
Assert.assertEquals(fatherVertex.getProperty("name"), "jupiter");
final FatherEdge childEdge = father.getSonEdge(FatherEdge.class);
Assert.assertTrue(childEdge != null);
final EdgeFrame edge = childEdge;
Assert.assertEquals(childEdge.getElement().outVertex().property("name").value(), "hercules");
}
开发者ID:Syncleus,
项目名称:Ferma,
代码行数:21,
代码来源:IncidenceMethodHandlerTest.java
示例16: testRemoveSonEdge
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@Test
public void testRemoveSonEdge() {
final TinkerGraph godGraph = TinkerGraph.open();
GodGraphLoader.load(godGraph);
final FramedGraph framedGraph = new DelegatingFramedGraph(godGraph, TEST_TYPES);
final List<? extends God> gods = framedGraph.traverse(
input -> input.V().has("name", "jupiter")).toList(God.class);
final God father = gods.iterator().next();
Assert.assertTrue(father != null);
final VertexFrame fatherVertex = father;
Assert.assertEquals(fatherVertex.getProperty("name"), "jupiter");
final FatherEdge child = father.getSonEdge(FatherEdge.class);
Assert.assertNotNull(child);
Assert.assertTrue(child instanceof EdgeFrame);
final EdgeFrame childEdge = child;
Assert.assertEquals(childEdge.getRawTraversal().outV().next().property("name").value(), "hercules");
father.removeSonEdge(child);
Assert.assertFalse(father.getSonEdges(FatherEdge.class).hasNext());
}
开发者ID:Syncleus,
项目名称:Ferma,
代码行数:26,
代码来源:IncidenceMethodHandlerTest.java
示例17: testDeleteSonEdge
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@Test
public void testDeleteSonEdge() {
final TinkerGraph godGraph = TinkerGraph.open();
GodGraphLoader.load(godGraph);
final FramedGraph framedGraph = new DelegatingFramedGraph(godGraph, TEST_TYPES);
final List<? extends God> gods = framedGraph.traverse(
input -> input.V().has("name", "jupiter")).toList(God.class);
final God father = gods.iterator().next();
Assert.assertTrue(father != null);
final VertexFrame fatherVertex = father;
Assert.assertEquals(fatherVertex.getProperty("name"), "jupiter");
final FatherEdge child = father.getSonEdge(FatherEdge.class);
Assert.assertNotNull(child);
Assert.assertTrue(child instanceof EdgeFrame);
final EdgeFrame childEdge = child;
Assert.assertEquals(childEdge.getRawTraversal().outV().next().property("name").value(), "hercules");
father.deleteSonEdge(child);
Assert.assertFalse(father.getSonEdges(FatherEdge.class).hasNext());
}
开发者ID:Syncleus,
项目名称:Ferma,
代码行数:26,
代码来源:IncidenceMethodHandlerTest.java
示例18: testGetSonEdges
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@Test
public void testGetSonEdges() {
final TinkerGraph godGraph = TinkerGraph.open();
GodGraphLoader.load(godGraph);
final FramedGraph framedGraph = new DelegatingFramedGraph(godGraph, TEST_TYPES);
final List<? extends God> gods = framedGraph.traverse(
input -> input.V().has("name", "jupiter")).toList(God.class);
final God father = gods.iterator().next();
Assert.assertTrue(father != null);
final VertexFrame fatherVertex = father;
Assert.assertEquals(fatherVertex.getProperty("name"), "jupiter");
final Iterator<? extends FatherEdge> childEdgeIterator = father.getSonEdges(FatherEdge.class);
Assert.assertTrue(childEdgeIterator.hasNext());
final FatherEdge childEdge = childEdgeIterator.next();
final God son = childEdge.getSon();
Assert.assertTrue(son != null);
final VertexFrame sonVertex = son;
Assert.assertEquals(sonVertex.getProperty("name"), "hercules");
}
开发者ID:Syncleus,
项目名称:Ferma,
代码行数:25,
代码来源:OutVertexMethodHandlerTest.java
示例19: testGetSonEdges
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@Test
public void testGetSonEdges() {
final TinkerGraph godGraph = TinkerGraph.open();
GodGraphLoader.load(godGraph);
final FramedGraph framedGraph = new DelegatingFramedGraph(godGraph, TEST_TYPES);
final List<? extends God> gods = framedGraph.traverse(
input -> input.V().has("name", "jupiter")).toList(God.class);
God father = gods.iterator().next();
Assert.assertTrue(father != null);
VertexFrame fatherVertex = father;
Assert.assertEquals(fatherVertex.getProperty("name"), "jupiter");
final Iterator<? extends FatherEdge> childEdgeIterator = father.getSonEdges(FatherEdge.class);
Assert.assertTrue(childEdgeIterator.hasNext());
final FatherEdge childEdge = childEdgeIterator.next();
father = childEdge.getFather();
Assert.assertTrue(father != null);
fatherVertex = father;
Assert.assertEquals(fatherVertex.getProperty("name"), "jupiter");
}
开发者ID:Syncleus,
项目名称:Ferma,
代码行数:25,
代码来源:InVertexMethodHandlerTest.java
示例20: testGetName
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@Test
public void testGetName() {
final Graph godGraph = TinkerGraph.open();
GodGraphLoader.load(godGraph);
final FramedGraph framedGraph = new DelegatingFramedGraph(godGraph, TEST_TYPES);
final List<? extends God> gods = framedGraph.traverse(
input -> input.V().has("name", "jupiter")).toList(God.class);
final God father = gods.iterator().next();
Assert.assertTrue(father != null);
final VertexFrame fatherVertex = father;
Assert.assertEquals(fatherVertex.getProperty("name"), "jupiter");
Assert.assertEquals("jupiter", father.getName());
}
开发者ID:Syncleus,
项目名称:Ferma,
代码行数:17,
代码来源:PropertyMethodHandlerTest.java
示例21: testObtainName
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@Test
public void testObtainName() {
final Graph godGraph = TinkerGraph.open();
GodGraphLoader.load(godGraph);
final FramedGraph framedGraph = new DelegatingFramedGraph(godGraph, TEST_TYPES);
final List<? extends God> gods = framedGraph.traverse(
input -> input.V().has("name", "jupiter")).toList(God.class);
final God father = gods.iterator().next();
Assert.assertTrue(father != null);
final VertexFrame fatherVertex = father;
Assert.assertEquals(fatherVertex.getProperty("name"), "jupiter");
Assert.assertEquals("jupiter", father.obtainName());
}
开发者ID:Syncleus,
项目名称:Ferma,
代码行数:17,
代码来源:PropertyMethodHandlerTest.java
示例22: testSetName
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@Test
public void testSetName() {
final Graph godGraph = TinkerGraph.open();
GodGraphLoader.load(godGraph);
final FramedGraph framedGraph = new DelegatingFramedGraph(godGraph, TEST_TYPES);
List<? extends God> gods = framedGraph.traverse(
input -> input.V().has("name", "jupiter")).toList(God.class);
God father = gods.iterator().next();
Assert.assertTrue(father != null);
VertexFrame fatherVertex = father;
Assert.assertEquals(fatherVertex.getProperty("name"), "jupiter");
father.setName("joopiter");
gods = framedGraph.traverse(
input -> input.V().has("name", "joopiter")).toList(God.class);
father = gods.iterator().next();
Assert.assertTrue(father != null);
fatherVertex = father;
Assert.assertEquals(fatherVertex.getProperty("name"), "joopiter");
}
开发者ID:Syncleus,
项目名称:Ferma,
代码行数:25,
代码来源:PropertyMethodHandlerTest.java
示例23: testApplyName
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@Test
public void testApplyName() {
final Graph godGraph = TinkerGraph.open();
GodGraphLoader.load(godGraph);
final FramedGraph framedGraph = new DelegatingFramedGraph(godGraph, TEST_TYPES);
List<? extends God> gods = framedGraph.traverse(
input -> input.V().has("name", "jupiter")).toList(God.class);
God father = gods.iterator().next();
Assert.assertTrue(father != null);
VertexFrame fatherVertex = father;
Assert.assertEquals(fatherVertex.getProperty("name"), "jupiter");
father.applyName("joopiter");
gods = framedGraph.traverse(
input -> input.V().has("name", "joopiter")).toList(God.class);
father = gods.iterator().next();
Assert.assertTrue(father != null);
fatherVertex = father;
Assert.assertEquals(fatherVertex.getProperty("name"), "joopiter");
}
开发者ID:Syncleus,
项目名称:Ferma,
代码行数:25,
代码来源:PropertyMethodHandlerTest.java
示例24: testRemoveName
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@Test
public void testRemoveName() {
final Graph godGraph = TinkerGraph.open();
GodGraphLoader.load(godGraph);
final FramedGraph framedGraph = new DelegatingFramedGraph(godGraph, TEST_TYPES);
List<? extends God> gods = framedGraph.traverse(
input -> input.V().has("name", "jupiter")).toList(God.class);
final God father = gods.iterator().next();
Assert.assertTrue(father != null);
final VertexFrame fatherVertex = father;
Assert.assertEquals(fatherVertex.getProperty("name"), "jupiter");
father.removeName();
Assert.assertNull(fatherVertex.getProperty("name"));
}
开发者ID:Syncleus,
项目名称:Ferma,
代码行数:19,
代码来源:PropertyMethodHandlerTest.java
示例25: testDeleteName
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@Test
public void testDeleteName() {
final Graph godGraph = TinkerGraph.open();
GodGraphLoader.load(godGraph);
final FramedGraph framedGraph = new DelegatingFramedGraph(godGraph, TEST_TYPES);
List<? extends God> gods = framedGraph.traverse(
input -> input.V().has("name", "jupiter")).toList(God.class);
final God father = gods.iterator().next();
Assert.assertTrue(father != null);
final VertexFrame fatherVertex = father;
Assert.assertEquals(fatherVertex.getProperty("name"), "jupiter");
father.deleteName();
Assert.assertNull(fatherVertex.getProperty("name"));
}
开发者ID:Syncleus,
项目名称:Ferma,
代码行数:19,
代码来源:PropertyMethodHandlerTest.java
示例26: iterator
点赞 3
import com.syncleus.ferma.VertexFrame; //导入依赖的package包/类
@Override
public Iterator<Vertex> iterator()
{
return new Iterator<Vertex>()
{
private final Iterator<? extends VertexFrame> iterator = iterable.iterator();
public void remove()
{
throw new UnsupportedOperationException();
}
public boolean hasNext()
{
return this.iterator.hasNext();
}
public Vertex next()
{
return iterator.next().getElement();
}
};
}
开发者ID:windup,
项目名称:windup,
代码行数:24,
代码来源:VertexFromFramedIterable.java