本文整理汇总了Java中com.thinkaurelius.titan.graphdb.types.system.SystemRelationType类的典型用法代码示例。如果您正苦于以下问题:Java SystemRelationType类的具体用法?Java SystemRelationType怎么用?Java SystemRelationType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SystemRelationType类属于com.thinkaurelius.titan.graphdb.types.system包,在下文中一共展示了SystemRelationType类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getIdentifier
import com.thinkaurelius.titan.graphdb.types.system.SystemRelationType; //导入依赖的package包/类
private long getIdentifier(final long schemaId, final SystemRelationType type, final Direction dir) {
int edgeDir = EdgeDirection.position(dir);
assert edgeDir==0 || edgeDir==1;
long typeid = (schemaId >>> SCHEMAID_BACK_SHIFT);
int systemTypeId;
if (type== BaseLabel.SchemaDefinitionEdge) systemTypeId=0;
else if (type== BaseKey.SchemaName) systemTypeId=1;
else if (type== BaseKey.SchemaCategory) systemTypeId=2;
else if (type== BaseKey.SchemaDefinitionProperty) systemTypeId=3;
else throw new AssertionError("Unexpected SystemType encountered in StandardSchemaCache: " + type.name());
//Ensure that there is enough padding
assert (systemTypeId<(1<<2));
return (((typeid<<2)+systemTypeId)<<1)+edgeDir;
}
示例2: getIdentifier
import com.thinkaurelius.titan.graphdb.types.system.SystemRelationType; //导入依赖的package包/类
private long getIdentifier(final long schemaId, final SystemRelationType type, final Direction dir) {
int edgeDir = EdgeDirection.position(dir);
assert edgeDir==0 || edgeDir==1;
long typeid = (schemaId >>> SCHEMAID_BACK_SHIFT);
int systemTypeId;
if (type== BaseLabel.SchemaDefinitionEdge) systemTypeId=0;
else if (type== BaseKey.SchemaName) systemTypeId=1;
else if (type== BaseKey.SchemaCategory) systemTypeId=2;
else if (type== BaseKey.SchemaDefinitionProperty) systemTypeId=3;
else throw new AssertionError("Unexpected SystemType encountered in StandardSchemaCache: " + type.getName());
//Ensure that there is enough padding
assert (systemTypeId<(1<<2));
return (((typeid<<2)+systemTypeId)<<1)+edgeDir;
}
示例3: evaluate
import com.thinkaurelius.titan.graphdb.types.system.SystemRelationType; //导入依赖的package包/类
@Override
public boolean evaluate(E element) {
switch(visibility) {
case NORMAL: return !((InternalElement)element).isInvisible();
case SYSTEM: return (element instanceof TitanRelation &&
((TitanRelation)element).getType() instanceof SystemRelationType)
|| (element instanceof TitanVertex && element instanceof TitanSchemaElement);
default: throw new AssertionError("Unrecognized visibility: " + visibility);
}
}
示例4: orderBy
import com.thinkaurelius.titan.graphdb.types.system.SystemRelationType; //导入依赖的package包/类
@Override
public Q orderBy(String keyName, org.apache.tinkerpop.gremlin.process.traversal.Order order) {
Preconditions.checkArgument(schemaInspector.containsPropertyKey(keyName), "Provided key does not exist: %s", keyName);
PropertyKey key = schemaInspector.getPropertyKey(keyName);
Preconditions.checkArgument(key != null && order != null, "Need to specify and key and an order");
Preconditions.checkArgument(Comparable.class.isAssignableFrom(key.dataType()),
"Can only order on keys with comparable data type. [%s] has datatype [%s]", key.name(), key.dataType());
Preconditions.checkArgument(key.cardinality() == Cardinality.SINGLE, "Ordering is undefined on multi-valued key [%s]", key.name());
Preconditions.checkArgument(!(key instanceof SystemRelationType), "Cannot use system types in ordering: %s", key);
Preconditions.checkArgument(!orders.containsKey(key));
Preconditions.checkArgument(orders.isEmpty(), "Only a single sort order is supported on vertex queries");
orders.add(key, Order.convert(order));
return getThis();
}
示例5: getProperty
import com.thinkaurelius.titan.graphdb.types.system.SystemRelationType; //导入依赖的package包/类
@Override
public<A> A getProperty(String key) {
if (key.equals(executor.stateKey)) {
return (A)executor.getVertexState(getLongId());
}
SystemRelationType t = SystemTypeManager.getSystemType(key);
if (t!=null && t instanceof ImplicitKey) return ((ImplicitKey)t).computeProperty(this);
throw getAccessException();
}
示例6: evaluate
import com.thinkaurelius.titan.graphdb.types.system.SystemRelationType; //导入依赖的package包/类
@Override
public boolean evaluate(E element) {
switch(visibility) {
case NORMAL: return !((InternalElement)element).isHidden();
case SYSTEM: return (element instanceof TitanRelation &&
((TitanRelation)element).getType() instanceof SystemRelationType)
|| (element instanceof TitanVertex && element instanceof TitanSchemaElement);
default: throw new AssertionError("Unrecognized visibility: " + visibility);
}
}
示例7: orderBy
import com.thinkaurelius.titan.graphdb.types.system.SystemRelationType; //导入依赖的package包/类
@Override
public Q orderBy(PropertyKey key, Order order) {
Preconditions.checkArgument(key!=null && order!=null,"Need to specify and key and an order");
Preconditions.checkArgument(Comparable.class.isAssignableFrom(key.getDataType()),
"Can only order on keys with comparable data type. [%s] has datatype [%s]", key.getName(), key.getDataType());
Preconditions.checkArgument(key.getCardinality()== Cardinality.SINGLE, "Ordering is undefined on multi-valued key [%s]", key.getName());
Preconditions.checkArgument(!(key instanceof SystemRelationType),"Cannot use system types in ordering: %s",key);
Preconditions.checkArgument(!orders.containsKey(key));
Preconditions.checkArgument(orders.isEmpty(),"Only a single sort order is supported on vertex queries");
orders.add(key, order);
return getThis();
}