當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。