Package com.thinkaurelius.titan.graphdb.types.vertices

Examples of com.thinkaurelius.titan.graphdb.types.vertices.TitanTypeVertex


     */

    private final TitanType makeTitanType(TitanTypeClass typeClass, String name, TypeAttribute.Map definition) {
        verifyOpen();
        Preconditions.checkArgument(StringUtils.isNotBlank(name));
        TitanTypeVertex type;
        if (typeClass == TitanTypeClass.KEY) {
            TypeAttribute.isValidKeyDefinition(definition);
            type = new TitanKeyVertex(this, temporaryID.decrementAndGet(), ElementLifeCycle.New);
        } else {
            Preconditions.checkArgument(typeClass == TitanTypeClass.LABEL);
            TypeAttribute.isValidLabelDefinition(definition);
            type = new TitanLabelVertex(this, temporaryID.decrementAndGet(), ElementLifeCycle.New);
        }
        graph.assignID(type);
        Preconditions.checkArgument(type.getID() > 0);
        addProperty(type, SystemKey.TypeName, name);
        addProperty(type, SystemKey.VertexState, SystemKey.VertexStates.DEFAULT.getValue());
        addProperty(type, SystemKey.TypeClass, typeClass);
        for (TypeAttribute attribute : definition.getAttributes()) {
            addProperty(type, SystemKey.TypeDefinition, attribute);
        }
        vertexCache.add(type, type.getID());
        typeCache.put(name, type.getID());
        return type;

    }
View Full Code Here

TOP

Related Classes of com.thinkaurelius.titan.graphdb.types.vertices.TitanTypeVertex

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.