Package org.eclipse.scanning.api.filter
Class Filter
java.lang.Object
org.eclipse.scanning.api.AbstractNameable
org.eclipse.scanning.api.filter.Filter
A springable class which encapsulates information for a given feature.
Filters
Filters work as follows:
L = list of things to be filtered e = excluded function i = included function l = filtered list.This means that all combinations are possible. An exclude of .* may be applied if only particular devices are required in the filter and everything done with includes. A particular set of devices may be removed but if one is required, it may be added back in with the final include.l = L-e(L)+i(L)
Example Spring
<bean id="filter" class="org.eclipse.scanning.api.filter.Filter" init-method="register">
<property name="name" value="org.eclipse.scanning.scannableFilter"/>
<property name="excludes">
<list>
<value>monitor.*</value>
<value>a</value>
<value>b</value>
<value>c</value>
<value>beam.*</value>
<value>neXusScannable.*</value>
<value>monitor1</value>
</list>
</property>
<property name="includes">
<list>
<value>monitor.*</value>
<value>beamcurrent</value>
<value>neXusScannable2</value>
<value>neXusScannable</value> <!-- Should not match anything -->
</list>
</property>
<property name="bundle" value="org.eclipse.scanning.example" /> <!-- Delete for real spring? -->
</bean>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanfilter(Collection<String> items) The list of exclude regular expressions These regular expressions are matched with the String.matches(String) method.The list of include regular expressions These regular expressions are matched with the String.matches(String) method.inthashCode()voidregister()voidsetExcludes(List<String> excludes) The list of exclude regular expressions These regular expressions are matched with the String.matches(String) method.voidsetIncludes(List<String> includes) The list of include regular expressions These regular expressions are matched with the String.matches(String) method.toString()Methods inherited from class org.eclipse.scanning.api.AbstractNameable
getName, setName
-
Constructor Details
-
Filter
public Filter()
-
-
Method Details
-
register
public void register() -
getExcludes
Description copied from interface:IFilterThe list of exclude regular expressions These regular expressions are matched with the String.matches(String) method.- Specified by:
getExcludesin interfaceIFilter<String>- Returns:
-
setExcludes
Description copied from interface:IFilterThe list of exclude regular expressions These regular expressions are matched with the String.matches(String) method.- Specified by:
setExcludesin interfaceIFilter<String>
-
getIncludes
Description copied from interface:IFilterThe list of include regular expressions These regular expressions are matched with the String.matches(String) method.- Specified by:
getIncludesin interfaceIFilter<String>- Returns:
-
setIncludes
Description copied from interface:IFilterThe list of include regular expressions These regular expressions are matched with the String.matches(String) method.- Specified by:
setIncludesin interfaceIFilter<String>
-
filter
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractNameable
-
equals
- Overrides:
equalsin classAbstractNameable
-
toString
- Overrides:
toStringin classAbstractNameable
-