本文整理汇总了Java中com.syncleus.ferma.TEdge类的典型用法代码示例。如果您正苦于以下问题:Java TEdge类的具体用法?Java TEdge怎么用?Java TEdge使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TEdge类属于com.syncleus.ferma包,在下文中一共展示了TEdge类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolve
import com.syncleus.ferma.TEdge; //导入依赖的package包/类
@Override
public <T> Class<? extends T> resolve(final Element element, final Class<T> kind) {
if (VertexFrame.class.equals(kind) || AbstractVertexFrame.class.equals(kind))
return (Class<? extends T>) TVertex.class;
else if (EdgeFrame.class.equals(kind) || AbstractEdgeFrame.class.equals(kind))
return (Class<? extends T>) TEdge.class;
return kind;
}
示例2: testInvalidAbstractVertexEdge
import com.syncleus.ferma.TEdge; //导入依赖的package包/类
@Test (expected = IllegalStateException.class)
public void testInvalidAbstractVertexEdge() {
TVertex v1 = fg.addFramedVertex();
TVertex v2 = fg.addFramedVertex();
TEdge e1 = fg.addFramedEdge(v1, v2, "some_label");
frameFactory.create(e1.getElement(), InvalidFrame.class);
}
示例3: testResolveWithDefault
import com.syncleus.ferma.TEdge; //导入依赖的package包/类
@Test
public void testResolveWithDefault() {
Element mockElement = Mockito.mock(Element.class);
Assert.assertEquals(resolver.resolve(mockElement, VertexFrame.class), TVertex.class);
Mockito.verifyZeroInteractions(mockElement);
Assert.assertEquals(resolver.resolve(mockElement, AbstractVertexFrame.class), TVertex.class);
Mockito.verifyZeroInteractions(mockElement);
Assert.assertEquals(resolver.resolve(mockElement, EdgeFrame.class), TEdge.class);
Mockito.verifyZeroInteractions(mockElement);
Assert.assertEquals(resolver.resolve(mockElement, AbstractEdgeFrame.class), TEdge.class);
Mockito.verifyZeroInteractions(mockElement);
Assert.assertEquals(resolver.resolve(mockElement, God.class), God.class);
Mockito.verifyZeroInteractions(mockElement);
}
示例4: testAddEdgeDefault
import com.syncleus.ferma.TEdge; //导入依赖的package包/类
@Test
public void testAddEdgeDefault() {
TEdge implTedge = arrayList.implementNewInterface();
ImplementsEdge implEdge = implTedge.reframe(ImplementsEdge.class);
implEdge.getInterface().setFullyQualifiedName(Iterable.class.getName());
JavaInterfaceVertex iterable = findInterfaceVertex(javaClassesGraph, Iterable.class);
Assert.assertNotNull(iterable);
Assert.assertEquals(Iterable.class.getName(), iterable.getFullyQualifiedName());
}
示例5: testAddUntypedEdgeTypedVertex
import com.syncleus.ferma.TEdge; //导入依赖的package包/类
@Test
public void testAddUntypedEdgeTypedVertex() {
TEdge implTedge = arrayList.implementNewType(JavaInterfaceVertex.DEFAULT_INITIALIZER);
ImplementsEdge implEdge = implTedge.reframe(ImplementsEdge.class);
implEdge.getInterface().setFullyQualifiedName(Iterable.class.getName());
JavaInterfaceVertex iterable = findInterfaceVertex(javaClassesGraph, Iterable.class);
Assert.assertNotNull(iterable);
Assert.assertEquals(Iterable.class.getName(), iterable.getFullyQualifiedName());
}
示例6: testAddFileParentEdgeDefault
import com.syncleus.ferma.TEdge; //导入依赖的package包/类
@Test
public void testAddFileParentEdgeDefault() {
final FramedGraph framedGraph = FileSystemGraphLoader.INSTANCE.load();
final DirectoryVertex home = findVertex(framedGraph, "name", "home", DirectoryVertex.class);
final TEdge newUserTEdge = home.createSubDirParentEdge();
final ParentEdge newUserEdge = newUserTEdge.reframe(ParentEdge.class);
final FileVertex userDir = newUserEdge.getChild();
userDir.setName(NEW_USER_NAME);
Assert.assertEquals(1, userDir.getParents().size());
Assert.assertEquals("home", userDir.getParents().get(0).getName());
}
示例7: testAddItemEdgeTyped
import com.syncleus.ferma.TEdge; //导入依赖的package包/类
@Test
public void testAddItemEdgeTyped() {
final FramedGraph framedGraph = FileSystemGraphLoader.INSTANCE.load();
final DirectoryVertex home = findVertex(framedGraph, "name", "home", DirectoryVertex.class);
final TEdge newUserDirTEdge = home.addItemEdge(DirectoryVertex.DEFAULT_INITIALIZER);
final DirectoryVertex newUserDir = (DirectoryVertex) newUserDirTEdge.reframe(ParentEdge.class).getChild();
newUserDir.setName(NEW_USER_NAME);
final TEdge newUserAddrBookTEdge = newUserDir.addItemEdge(FileVertex.DEFAULT_INITIALIZER);
final FileVertex newUserAddrBook = newUserAddrBookTEdge.reframe(ParentEdge.class).getChild();
newUserAddrBook.setName(ADDR_BOOK_FILE_NAME);
assertNewUserAndAddrBook(framedGraph);
}
示例8: createSubDirParentEdge
import com.syncleus.ferma.TEdge; //导入依赖的package包/类
@Incidence(label = "parent", direction = Direction.IN, operation = Incidence.Operation.ADD)
public abstract TEdge createSubDirParentEdge();
示例9: createSubDirChildEdge
import com.syncleus.ferma.TEdge; //导入依赖的package包/类
@Incidence(label = "parent", direction = Direction.OUT, operation = Incidence.Operation.ADD)
public abstract TEdge createSubDirChildEdge();
示例10: addItemEdge
import com.syncleus.ferma.TEdge; //导入依赖的package包/类
@Incidence(label = "parent", direction = Direction.IN, operation = Incidence.Operation.ADD)
public abstract <T extends FileVertex> TEdge addItemEdge(ClassInitializer<? extends T> initializer);
示例11: addChild
import com.syncleus.ferma.TEdge; //导入依赖的package包/类
@Incidence(label = "parent", direction = Direction.IN)
public abstract TEdge addChild(FileVertex child);
示例12: implementNewInterface
import com.syncleus.ferma.TEdge; //导入依赖的package包/类
@Incidence(label = "implements", direction = Direction.OUT, operation = Incidence.Operation.ADD)
public TEdge implementNewInterface();
示例13: implementNewType
import com.syncleus.ferma.TEdge; //导入依赖的package包/类
@Incidence(label = "implements", direction = Direction.OUT, operation = Incidence.Operation.ADD)
public TEdge implementNewType(ClassInitializer<? extends JavaInterfaceVertex> typeInitializer);
示例14: implementInterface
import com.syncleus.ferma.TEdge; //导入依赖的package包/类
@Incidence(label = "implements", direction = Direction.OUT, operation = Incidence.Operation.ADD)
TEdge implementInterface(JavaInterfaceVertex iface);