本文整理了Java中xdi2.core.Graph.isEmpty()
方法的一些代码示例,展示了Graph.isEmpty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.isEmpty()
方法的具体详情如下:
包路径:xdi2.core.Graph
类名称:Graph
方法名:isEmpty
[英]Checks if the graph is empty. This is equivalent to calling getRootContextNode().isEmpty();
[中]检查图形是否为空。这相当于调用getRootContextNode()。isEmpty();
代码示例来源:origin: projectdanube/xdi2
if (! callbackMessageEnvelopeGraph.isEmpty()) callbackMessageEnvelope = MessageEnvelope.fromGraph(callbackMessageEnvelopeGraph);
if (! callbackFullMessagingResponseGraph.isEmpty()) callbackMessagingResponse = FullMessagingResponse.fromGraph(callbackFullMessagingResponseGraph);
} else {
代码示例来源:origin: projectdanube/xdi2
public void testReadJson() throws Exception {
Graph graph3 = this.getGraphFactory().openGraph(this.getClass().getName() + "-graph-3");
XDIReader reader = XDIReaderRegistry.forFormat("XDI/JSON", null);
reader.read(graph3, AbstractGraphTest.class.getResourceAsStream("test.json")).close();
testGraph(graph3);
graph3.getRootContextNode().clear();
assertTrue(graph3.isEmpty());
graph3.close();
}
代码示例来源:origin: projectdanube/xdi2
if (refRepTargetContextNode != null && ! operationResultGraph.isEmpty()) {
代码示例来源:origin: projectdanube/xdi2
assertFalse(executionResult.makeLightMessagingResponse().getResultGraph().isEmpty());
assertTrue(executionResult.makeLightMessagingResponse().getResultGraph().isEmpty());
代码示例来源:origin: projectdanube/xdi2
graph18.rollbackTransaction();
assertTrue(graph18.supportsTransactions() ? ! graph18.isEmpty() : graph18.isEmpty());
graph18.commitTransaction();
assertTrue(graph18.isEmpty());
代码示例来源:origin: projectdanube/xdi2
public void testIdentity() throws Exception {
Graph graph = MemoryGraphFactory.getInstance().openGraph();
ContextNode contextNode = graph.getRootContextNode().setContextNode(XDIArc.create("=markus"));
ContextNode identityContextNode = graph.getRootContextNode().setDeepContextNode(XDIAddress.create("=pseudo"));
// test $is
Equivalence.setIdentityContextNode(contextNode, identityContextNode);
assertEquals(Equivalence.getIdentityContextNodes(contextNode).next(), identityContextNode);
assertEquals(Equivalence.getIncomingIdentityContextNodes(identityContextNode).next(), contextNode);
assertEquals(Equivalence.getIdentityRelations(contextNode).next(), contextNode.getRelation(XDIDictionaryConstants.XDI_ADD_IS));
assertEquals(Equivalence.getIncomingIdentityRelations(identityContextNode).next(), contextNode.getRelation(XDIDictionaryConstants.XDI_ADD_IS));
Equivalence.getIdentityContextNodes(contextNode).next().delete();
// done
assertTrue(contextNode.isEmpty());
assertTrue(identityContextNode.isEmpty());
contextNode.delete();
assertTrue(graph.isEmpty());
graph.close();
}
代码示例来源:origin: projectdanube/xdi2
assertTrue(replacementContextNode.isEmpty());
contextNode.delete();
assertTrue(graph.isEmpty());
代码示例来源:origin: projectdanube/xdi2
assertTrue(root.isRootContextNode());
assertTrue(graph13.isEmpty());
assertTrue(root.isEmpty());
assertFalse(root.containsContextNodes());
代码示例来源:origin: projectdanube/xdi2
assertTrue(graph30.isEmpty());
内容来源于网络,如有侵权,请联系作者删除!