com.maxifier.mxcache.impl.resource.CollectingDependencyNodeVisitor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mxcache-runtime Show documentation
Show all versions of mxcache-runtime Show documentation
Constains all classes necessary for launching a MxCache-instrumentated application
/*
* 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;
}
}