edu.uchsc.ccp.knowtator
Class FilterUtil

java.lang.Object
  extended by edu.uchsc.ccp.knowtator.FilterUtil

public class FilterUtil
extends Object


Field Summary
static int ANY_FILTER
           
static int CONSENSUS_FILTER
           
static int NONCONSENSUS_FILTER
           
 
Constructor Summary
FilterUtil(KnowtatorManager manager)
          Creates a new instance of FilterUtil
 
Method Summary
 Collection<SimpleInstance> filterAnnotations(Collection<SimpleInstance> annotationInstances, SimpleInstance filterInstance)
           
 List<SimpleInstance> filterAnnotations(Collection<SimpleInstance> annotationInstances, SimpleInstance filterInstance, boolean ignoreTypeFilter)
           
 List<SimpleInstance> filterAnnotations(Collection<SimpleInstance> annotationInstances, SimpleInstance filterInstance, boolean ignoreTypeFilter, boolean textViewerSelectable)
           
static List<SimpleInstance> getAnnotators(SimpleInstance filter)
          Returns the annotators specified by the filter.
 int getCurrentFilterIndex()
           
 SimpleInstance getNextFilter(int filterType)
           
 SimpleInstance getPreviousFilter(int filterType)
           
static Set<SimpleInstance> getSets(SimpleInstance filter)
           
static Set<Cls> getTypes(SimpleInstance filter)
          Returns the types specified by the filter.
 boolean isClsLicensedByFilter(SimpleInstance filter, Frame frame)
           
static boolean isConsensusFilter(SimpleInstance filter)
           
 void selectNextFilter(int filterType)
           
 void selectPreviousFilter(int filterType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANY_FILTER

public static final int ANY_FILTER
See Also:
Constant Field Values

CONSENSUS_FILTER

public static final int CONSENSUS_FILTER
See Also:
Constant Field Values

NONCONSENSUS_FILTER

public static final int NONCONSENSUS_FILTER
See Also:
Constant Field Values
Constructor Detail

FilterUtil

public FilterUtil(KnowtatorManager manager)
Creates a new instance of FilterUtil

Method Detail

filterAnnotations

public Collection<SimpleInstance> filterAnnotations(Collection<SimpleInstance> annotationInstances,
                                                    SimpleInstance filterInstance)

isClsLicensedByFilter

public boolean isClsLicensedByFilter(SimpleInstance filter,
                                     Frame frame)

filterAnnotations

public List<SimpleInstance> filterAnnotations(Collection<SimpleInstance> annotationInstances,
                                              SimpleInstance filterInstance,
                                              boolean ignoreTypeFilter,
                                              boolean textViewerSelectable)
Parameters:
textViewerSelectable - - true if you want to filter out annotations of the types specified in the knowtator_types_not_selectable_from_text_viewer slot of the filter.

filterAnnotations

public List<SimpleInstance> filterAnnotations(Collection<SimpleInstance> annotationInstances,
                                              SimpleInstance filterInstance,
                                              boolean ignoreTypeFilter)
Parameters:
annotationInstances -
filterInstance -
ignoreTypeFilter - - will ignore the type of the annotation when filtering if true. If true, then the value of textviewerSelectable is ignored.

getTypes

public static Set<Cls> getTypes(SimpleInstance filter)
Returns the types specified by the filter. This method will not return null - but rather an empty set if no type has been specified by the filter.


getAnnotators

public static List<SimpleInstance> getAnnotators(SimpleInstance filter)
Returns the annotators specified by the filter. This method will not return null - but rather an empty set if no annotator has been specified by the filter.


getSets

public static Set<SimpleInstance> getSets(SimpleInstance filter)

isConsensusFilter

public static boolean isConsensusFilter(SimpleInstance filter)

getPreviousFilter

public SimpleInstance getPreviousFilter(int filterType)

getCurrentFilterIndex

public int getCurrentFilterIndex()

getNextFilter

public SimpleInstance getNextFilter(int filterType)
Parameters:
filterType - one of ANY_FILTER, CONSENSUS_FILTER, or NONCONSENSUS_FILTER
Returns:
the next filter of the provided type

selectNextFilter

public void selectNextFilter(int filterType)
                      throws ConsensusException
Throws:
ConsensusException

selectPreviousFilter

public void selectPreviousFilter(int filterType)
                          throws ConsensusException
Throws:
ConsensusException