List of usage examples for java.util Deque contains
boolean contains(Object o);
From source file:org.polymap.core.data.pipeline.DefaultPipelineIncubator.java
protected boolean findTransformation(ProcessorDescription from, ProcessorDescription to, LayerUseCase usecase, Deque<ProcessorDescription> chain) { log.debug(StringUtils.repeat(" ", chain.size()) + "findTransformation: " + from + " => " + to + " -- " + usecase);// w w w . j a v a 2 s. c o m // recursion break if (chain.size() > 16) { return false; } // recursion start if (from.getSignature().isCompatible(to.getSignature())) { chain.addLast(to); log.debug(StringUtils.repeat(" ", chain.size()) + "Transformation found: " + chain); return true; } // recursion step else { for (ProcessorDescription desc : allTransformers(usecase)) { if (from.getSignature().isCompatible(desc.getSignature()) && !chain.contains(desc)) { chain.addLast(desc); if (findTransformation(desc, to, usecase, chain)) { //log.debug( " transformation found: " + desc ); return true; } chain.removeLast(); } } return false; } }