Package clojure.lang

Examples of clojure.lang.Keyword


    public void ensureIndex(boolean unique, boolean dropDups, IPersistentStack fields) {
        IndexOptionsBuilder options = new IndexOptionsBuilder();
        while (fields.count() > 0) {
            Object fieldName = fields.peek();
            if (fieldName instanceof Keyword) {
                Keyword k = (Keyword) fieldName;
                fieldName = k.getName();
            }
            options.field(fieldName.toString()).ascending();
            fields = fields.pop();
        }
        if (unique) {
View Full Code Here


        }
    }

    private String toString(Object key) {
        if (key instanceof Keyword) {
            Keyword kw = (Keyword) key;
            return kw.getName();
        }
        return key.toString();
    }
View Full Code Here

        throw new UnsupportedOperationException();
    }

    public CloseableIterable<T> get(final String key, final Object value) {
        boolean matched = ((indexKeys == null) || ((indexKeys != null) && indexKeys.contains(key)));
        Keyword attribute = null;
        if ((this.getIndexClass().isAssignableFrom(FluxEdge.class)) && ("label".equals(key))) {
            attribute = Keyword.intern("graph.edge/label");
        }
        else {
            attribute = FluxUtil.createKey(key, value.getClass(), clazz);
View Full Code Here

        throw new UnsupportedOperationException();
    }

    public long count(final String key, final Object value) {
        boolean matched = ((indexKeys == null) || ((indexKeys != null) && indexKeys.contains(key)));
        Keyword attribute = null;
        if ((this.getIndexClass().isAssignableFrom(FluxEdge.class)) && ("label".equals(key))) {
            attribute = Keyword.intern("graph.edge/label");
        }
        else {
            attribute = FluxUtil.createKey(key, value.getClass(), clazz);
View Full Code Here

        }
        Set<String> finalproperties = new HashSet<String>();
        Set properties = getDatabase().entity(id).keySet();
        Iterator<Keyword> propertiesit = properties.iterator();
        while (propertiesit.hasNext()) {
            Keyword property = propertiesit.next();
            if (!FluxUtil.isReservedKey(property.toString())) {
                finalproperties.add(FluxUtil.getPropertyName(property));
            }
        }
        return finalproperties;
    }
View Full Code Here

        if (!FluxUtil.isReservedKey(key)) {
            Set properties = getDatabase().entity(id).keySet();
            Iterator<Keyword> propertiesit = properties.iterator();
            // We need to iterate, as we don't know the exact type (although we ensured that only one attribute will have that name)
            while (propertiesit.hasNext()) {
                Keyword property = propertiesit.next();
                String propertyname = FluxUtil.getPropertyName(property);
                if (key.equals(propertyname)) {
                    return getDatabase().entity(id).get(property);
                }
            }
View Full Code Here

        Entity entity = getDatabase().entity(id);
        // Add the base facts associated with this edge
        Set properties = entity.keySet();
        Iterator<Keyword> propertiesIt = properties.iterator();
        while (propertiesIt.hasNext()) {
            Keyword property = propertiesIt.next();
            // Add all properties (except the ident property (is only originally used for retrieving the id of the created elements)
            if (!property.toString().equals(":db/ident")) {
                theFacts.add(FluxUtil.map(":db/id", id, property.toString(), entity.get(property).toString()));
            }
        }
        return theFacts;
    }
View Full Code Here

TOP

Related Classes of clojure.lang.Keyword

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.