001package org.biopax.paxtools.query.wrapperL3; 002 003import org.biopax.paxtools.model.level3.Level3Element; 004 005import java.util.Set; 006 007/** 008 * Filters out ubiquitous entities, whose IDs are supplied by user. 009 * 010 * @author Ozgun Babur 011 */ 012public class UbiqueFilter extends Filter 013{ 014 /** 015 * IDs of ubiquitous entities. 016 */ 017 private Set<String> ubiqueIDs; 018 019 /** 020 * Constructor. 021 * @param ubiqueIDs IDS of ubiquitous entities 022 */ 023 public UbiqueFilter(Set<String> ubiqueIDs) 024 { 025 this.ubiqueIDs = ubiqueIDs; 026 } 027 028 /** 029 * Checks if the ID of the given element is in the black list. 030 * @param ele level 3 element to check 031 * @return true if the element is not black-listed 032 */ 033 @Override 034 public boolean okToTraverse(Level3Element ele) 035 { 036 return !ubiqueIDs.contains(ele.getRDFId()); 037 } 038}