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

com.maxifier.mxcache.impl.resource.CollectingDependencyNodeVisitor Maven / Gradle / Ivy

Go to download

Constains all classes necessary for launching a MxCache-instrumentated application

There is a newer version: 2.6.9
Show newest version
/*
 * Copyright (c) 2008-2014 Maxifier Ltd. All Rights Reserved.
 */
package com.maxifier.mxcache.impl.resource;

import java.util.Queue;
import java.util.Set;

/**
 * @author Alexander Kochurov ([email protected])
 */
class CollectingDependencyNodeVisitor implements DependencyNodeVisitor {
    private final Set nodes;
    private final Queue queue;

    public CollectingDependencyNodeVisitor(Set nodes, Queue queue) {
        this.nodes = nodes;
        this.queue = queue;
    }

    @Override
    public void visit(DependencyNode node) {
        if (nodes.add(node)) {
            queue.add(node);
        }
    }

    @Override
    public Set getNodes() {
        return nodes;
    }

    @Override
    public Queue getQueue() {
        return queue;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy