Package org.jrdf.query.relation.type

Examples of org.jrdf.query.relation.type.NodeType


    private static final int PREDICATE_NODE_TYPE = 4;
    private static final int OBJECT_NODE_TYPE = 5;
    private static final int RESOURCE_NODE_TYPE = 6;

    public NodeType entryToObject(TupleInput tupleInput) {
        NodeType tmpNodeType;
        byte b = tupleInput.readByte();
        switch (b) {
            case BLANK_NODE_TYPE:
                tmpNodeType = new BlankNodeType();
                break;
View Full Code Here


    public Attribute entryToObject(TupleInput tupleInput) {
        final byte b = tupleInput.readByte();
        Attribute attribute;
        if (b == NORMAL_ATTRIBUTE) {
            AttributeName name = nameBinding.entryToObject(tupleInput);
            NodeType type = typeBinding.entryToObject(tupleInput);
            attribute = new AttributeImpl(name, type);
        } else if (b == NULLARY_ATTRIBUTE) {
            attribute = NullaryAttribute.NULLARY_ATTRIBUTE;
        } else {
            throw new IllegalArgumentException("Cannot read class type: " + b);
View Full Code Here

    private LinkedHashSet<Attribute> extractAttributes() throws ParserException {
        LinkedHashSet<Attribute> newAttributes = new LinkedHashSet<Attribute>();
        Map<AttributeName, PositionalNodeType> variables = varCollector.getAttributes();
        for (AttributeName variable : declaredVariables) {
            NodeType type = variables.get(variable);
            if (type == null) {
                String literal = variable.getLiteral();
                throw new ParserException(new TIdentifier(literal), "Failed to find variable " +
                    literal + " in where clause. ");
            } else {
View Full Code Here

    }

    private Attribute createNewAttribute(Attribute existingAttribute,
        Map<AttributeName, ? extends NodeType> allVariables) {
        AttributeName existingAttributeName = existingAttribute.getAttributeName();
        NodeType newNodeType = allVariables.get(existingAttributeName);
        if (newNodeType == null) {
            newNodeType = existingAttribute.getType();
        }
        return new AttributeImpl(existingAttributeName, newNodeType);
    }
View Full Code Here

        Map<Attribute, Node> returnValue = new HashMap<Attribute, Node>(1);
        final Map<AttributeName, PositionalNodeType> namePosMap = collector.getAttributes();
        if (attributeName == null) {
            returnValue.put(NULLARY_ATTRIBUTE, value);
        } else {
            NodeType type = namePosMap.get(attributeName);
            type = (type == null) ? new ObjectNodeType() : type;
            Attribute attribute = new AttributeImpl(attributeName, type);
            returnValue.put(attribute, value);
            collector.addConstraints(returnValue);
        }
View Full Code Here

    }

    private void updateEntry(final Attribute newAttribute) {
        final AttributeName key = newAttribute.getAttributeName();
        final PositionalNodeType currentEntry = variables.get(key);
        final NodeType type = newAttribute.getType();
        if (type instanceof PositionalNodeType) {
            if (!currentEntry.getClass().equals(type.getClass())) {
                variables.put(key, currentEntry.upgrade((PositionalNodeType) type));
            }
        }
    }
View Full Code Here

            }
        }
    }

    private void addNewEntry(final Attribute attribute) {
        final NodeType nodeType = attribute.getType();
        if (nodeType instanceof PositionalNodeType) {
            variables.put(attribute.getAttributeName(), (PositionalNodeType) nodeType);
        }
    }
View Full Code Here

TOP

Related Classes of org.jrdf.query.relation.type.NodeType

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.