本文整理汇总了Java中com.thinkaurelius.titan.core.TitanVertex.longId方法的典型用法代码示例。如果您正苦于以下问题:Java TitanVertex.longId方法的具体用法?Java TitanVertex.longId怎么用?Java TitanVertex.longId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.thinkaurelius.titan.core.TitanVertex
的用法示例。
在下文中一共展示了TitanVertex.longId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testBasic
import com.thinkaurelius.titan.core.TitanVertex; //导入方法依赖的package包/类
/**
* Very simple graph operation to ensure minimal functionality and cleanup
*/
@Test
public void testBasic() {
PropertyKey uid = makeVertexIndexedUniqueKey("name", String.class);
finishSchema();
TitanVertex n1 = tx.addVertex();
uid = tx.getPropertyKey("name");
n1.property(uid.name(), "abcd");
clopen();
long nid = n1.longId();
uid = tx.getPropertyKey("name");
assertTrue(getV(tx, nid) != null);
assertTrue(getV(tx, uid.longId()) != null);
assertMissing(tx, nid + 64);
uid = tx.getPropertyKey(uid.name());
n1 = getV(tx, nid);
assertEquals(n1, getOnlyVertex(tx.query().has(uid.name(), "abcd")));
assertEquals(1, Iterables.size(n1.query().relations())); //TODO: how to expose relations?
assertEquals("abcd", n1.value(uid.name()));
assertCount(1, tx.query().vertices());
close();
TitanCleanup.clear(graph);
open(config);
assertEmpty(tx.query().vertices());
}
示例2: add
import com.thinkaurelius.titan.core.TitanVertex; //导入方法依赖的package包/类
@Override
public void add(TitanVertex n) {
if (!vertices.isEmpty()) sorted = sorted && vertices.get(vertices.size()-1)<=n.longId();
vertices.add(n.longId());
}
示例3: add
import com.thinkaurelius.titan.core.TitanVertex; //导入方法依赖的package包/类
@Override
public void add(TitanVertex n) {
if (!vertices.isEmpty()) sorted = sorted && (vertices.get(vertices.size()-1).longId()<=n.longId());
vertices.add(n);
}