001package org.biopax.paxtools.pattern.constraint;
002
003import org.biopax.paxtools.model.level3.PhysicalEntity;
004import org.biopax.paxtools.pattern.Match;
005import org.biopax.paxtools.pattern.util.Blacklist;
006
007/**
008 * This is a non-generative constraint that checks if the small molecule is ubiquitous in any
009 * context.
010 *
011 * Var0 - PhysicalEntity
012 *
013 * @author Ozgun Babur
014 */
015public class NonUbique extends ConstraintAdapter
016{
017        public NonUbique(Blacklist blacklist)
018        {
019                super(1, blacklist);
020        }
021
022        @Override
023        public boolean satisfies(Match match, int... ind)
024        {
025                PhysicalEntity pe = (PhysicalEntity) match.get(ind[0]);
026                return !blacklist.isUbique(pe);
027        }
028}