Class 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
    • Constructor Detail

      • Rule

        public Rule​(String pattern,
                    String kind,
                    List<String> commands,
                    boolean excludes)
        Primary Constructor
      • Rule

        public Rule()
        Constructor
    • 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()
        get the commands
      • setCommands

        public void setCommands​(List<String> commands)
        set the commands
      • 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:
        dataLabel in interface xal.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:
        update in interface xal.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:
        write in interface xal.tools.data.DataListener
        Parameters:
        adaptor - The data adaptor corresponding to this object's data node.