Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/bdgp/apps/dagedit/gui/TypeFilter.java


1   package org.bdgp.apps.dagedit.gui;
2   
3   import java.util.*;
4   import org.bdgp.apps.dagedit.datamodel.*;
5   import org.bdgp.util.*;
6   
7   public class TypeFilter implements VectorFilter {
8       HashSet types;
9       
10      public TypeFilter() {
11    types = new HashSet();
12      }
13      
14      public boolean satisfies(Object o) {
15    TermRelationship tr = (TermRelationship) o;
16    return types.contains(tr.getType());
17      }
18      
19      public void addType(TermRelationshipType type) {
20    types.add(type);
21      }
22  
23      public void setTypes(Vector types) {
24    this.types.addAll(types);
25      }
26  
27      public HashSet getTypes() {
28    return types;
29      }
30  
31      public void removeType(TermRelationshipType type) {
32    types.remove(type);
33      }
34  }
35