当前位置: 首页>>代码示例>>Java>>正文


Java SystemRelationType类代码示例

本文整理汇总了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;
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:17,代码来源:StandardSchemaCache.java

示例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;
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:17,代码来源:StandardSchemaCache.java

示例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);
    }
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:11,代码来源:VisibilityFilterCondition.java

示例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();
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:15,代码来源:BaseVertexCentricQueryBuilder.java

示例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();
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:10,代码来源:FulgoraNeighborVertex.java

示例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);
    }
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:11,代码来源:VisibilityFilterCondition.java

示例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();
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:13,代码来源:BaseVertexCentricQueryBuilder.java


注:本文中的com.thinkaurelius.titan.graphdb.types.system.SystemRelationType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。