Package xal.app.launcher
Class Rule
- java.lang.Object
-
- xal.app.launcher.Rule
-
- All Implemented Interfaces:
xal.tools.data.DataListener
public class Rule extends Object implements xal.tools.data.DataListener
Rule for running an application with a specified wildcard pattern
-
-
Field Summary
Fields Modifier and Type Field Description static StringDATA_LABELDataAdaptor label used in reading and writing
-
Constructor Summary
Constructors Constructor Description Rule()ConstructorRule(String pattern, String kind, String... commands)ConstructorRule(String pattern, String kind, List<String> commands)ConstructorRule(String pattern, String kind, List<String> commands, boolean excludes)Primary Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringdataLabel()provides the name used to identify the class in an external data source.voiddeleteCommandAtIndex(int index)delete the rule at the specified indexbooleanexcludes()determine whether matching files are excludedList<String>getCommands()get the commandsList<String>getCommands(App application)get the commands using the application's specific substitution for file path (%f) and name (%n)static RulegetInstance(xal.tools.data.DataAdaptor adaptor)create an instance from a data adaptorStringgetKind()get the kindStringgetPattern()get the file wildcard patternvoidinsertCommandAtIndex(String command, int index)insert a command at the specified indexbooleanmatches(File file)determine whether this rule matches the specified filebooleanmatches(App application)determine whether this rule matches the specified applicationbooleanmatchesFileName(String fileName)determine whether this rule matches the specified file namevoidsetCommands(List<String> commands)set the commandsvoidsetExcludes(boolean excludes)set whether matching files are excludedvoidsetKind(String kind)set the kindvoidsetPattern(String pattern)set the file wildcard patternvoidupdate(xal.tools.data.DataAdaptor adaptor)Instructs the receiver to update its data based on the given adaptor.voidwrite(xal.tools.data.DataAdaptor adaptor)Instructs the receiver to write its data to the adaptor for external storage.
-
-
-
Field Detail
-
DATA_LABEL
public static final String DATA_LABEL
DataAdaptor label used in reading and writing- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static Rule getInstance(xal.tools.data.DataAdaptor adaptor)
create an instance from a data adaptor
-
getPattern
public String getPattern()
get the file wildcard pattern
-
setPattern
public void setPattern(String pattern)
set the file wildcard pattern
-
getCommands
public List<String> getCommands(App application)
get the commands using the application's specific substitution for file path (%f) and name (%n)
-
insertCommandAtIndex
public void insertCommandAtIndex(String command, int index)
insert a command at the specified index
-
deleteCommandAtIndex
public void deleteCommandAtIndex(int index)
delete the rule at the specified index
-
excludes
public boolean excludes()
determine whether matching files are excluded
-
setExcludes
public void setExcludes(boolean excludes)
set whether matching files are excluded
-
getKind
public String getKind()
get the kind
-
setKind
public void setKind(String kind)
set the kind
-
matches
public boolean matches(App application)
determine whether this rule matches the specified application
-
matches
public boolean matches(File file)
determine whether this rule matches the specified file
-
matchesFileName
public boolean matchesFileName(String fileName)
determine whether this rule matches the specified file name
-
dataLabel
public String dataLabel()
provides the name used to identify the class in an external data source.- Specified by:
dataLabelin interfacexal.tools.data.DataListener- Returns:
- The tag for this data node.
-
update
public void update(xal.tools.data.DataAdaptor adaptor)
Instructs the receiver to update its data based on the given adaptor.- Specified by:
updatein interfacexal.tools.data.DataListener- Parameters:
adaptor- The data adaptor corresponding to this object's data node.
-
write
public void write(xal.tools.data.DataAdaptor adaptor)
Instructs the receiver to write its data to the adaptor for external storage.- Specified by:
writein interfacexal.tools.data.DataListener- Parameters:
adaptor- The data adaptor corresponding to this object's data node.
-
-