edu.uchsc.ccp.knowtator
Class FilterUtil
java.lang.Object
edu.uchsc.ccp.knowtator.FilterUtil
public class FilterUtil
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
FilterUtil
public FilterUtil(KnowtatorManager manager)
- Creates a new instance of FilterUtil
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