All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nedap.archie.rmobjectvalidator.APathQueryCache Maven / Gradle / Ivy

Go to download

tools that operate on the archie reference models and archetype object model

There is a newer version: 3.12.0
Show newest version
package com.nedap.archie.rmobjectvalidator;

import com.nedap.archie.query.RMPathQuery;

import java.util.HashMap;

/**
 * APath query cache. NOT thread-safe!
 * Created by pieter.bos on 27/05/16.
 */
public class APathQueryCache {

    private final boolean matchSpecialisedNodes;
    private final HashMap queryCache = new HashMap<>();

    public APathQueryCache() {
        this(false);
    }

    public APathQueryCache(boolean matchSpecialisedNodes) {
        this.matchSpecialisedNodes = matchSpecialisedNodes;
    }

    public RMPathQuery getApathQuery(String query) {
        RMPathQuery result = queryCache.get(query);
        if (result == null) {
            result = new RMPathQuery(query, matchSpecialisedNodes);
            queryCache.put(query, result);
        }
        return result;

    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy