Package org.jrdf.query.relation.attributename

Examples of org.jrdf.query.relation.attributename.AttributeName


    private static final int VARIABLE_NAME = 1;

    public AttributeName entryToObject(TupleInput tupleInput) {
        final byte b = tupleInput.readByte();
        final String name = tupleInput.readString();
        AttributeName attributeName;
        switch (b) {
            case POSITION_NAME:
                attributeName = new PositionName(name);
                break;
            case VARIABLE_NAME:
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 {
View Full Code Here

    public Attribute findOneCachedAttribute(SingleConstraint constraint) {
        Set<Attribute> attributes = constraint.getHeadings();
        Map<Integer, Attribute> map = new TreeMap<Integer, Attribute>();
        for (Attribute attribute : attributes) {
            AttributeName attributeName = attribute.getAttributeName();
            if (attributeName instanceof VariableName && getCachedValues(attributeName) != null) {
                map.put(getCachedValues(attributeName).size(), attribute);
            }
        }
        if (map.isEmpty()) {
View Full Code Here

            }
        }
    }

    private void updateCache(EvaluatedRelation result, long time, Attribute attribute) {
        AttributeName attributeName = attribute.getAttributeName();
        Set<Node> voSet = getMatchingVOs(attribute, getTuples(result, attribute));
        Set<Node> cached = cache.get(attributeName);
        if (time > timeStamp) {
            timeStamp = time;
        }
View Full Code Here

        }
        return set;
    }

    private boolean matches(Set<Attribute> source, Attribute attr) {
        AttributeName name = attr.getAttributeName();
        for (Attribute attr1 : source) {
            AttributeName name1 = attr1.getAttributeName();
            if (name instanceof VariableName && name.equals(name1)) {
                return true;
            }
        }
        return false;
View Full Code Here

        return o1.singleAvp.equals(o2.singleAvp);
    }

    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

        Node value = createLiteral(node);
        avp.put(attribute, value);
    }

    private void createAttributeValuePair(NodeType type, Node anyNode, String variableName) {
        AttributeName attributeName = new VariableName(variableName);
        Attribute att = new AttributeImpl(attributeName, type);
        avp.put(att, anyNode);
    }
View Full Code Here

            addNewEntry(attribute);
        }
    }

    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 readObject(ObjectInputStream input) throws IOException, ClassNotFoundException {
        variables = new HashMap<AttributeName, PositionalNodeType>();
        int elements = input.readInt();
        for (int i = 0; i < elements; i++) {
            AttributeName attribute = (AttributeName) input.readObject();
            PositionalNodeType node = (PositionalNodeType) input.readObject();
            variables.put(attribute, node);
        }
    }
View Full Code Here

TOP

Related Classes of org.jrdf.query.relation.attributename.AttributeName

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.