Class CommandSet

java.lang.Object
org.harctoolbox.girr.XmlExporter
org.harctoolbox.girr.CommandSet
All Implemented Interfaces:
Serializable, Iterable<Command>, Named

public final class CommandSet extends XmlExporter implements Named, Iterable<Command>
A CommandSet is a set of Commands with unique names. Typically, but not necessarily, they share the same protocol, but with different parameter values.
See Also:
  • Constructor Details

  • Method Details

    • getCommands

      public Collection<Command> getCommands()
      Returns the Commands in the CommandSet.
      Returns:
      unmodifiable Map.
    • getNumberOfCommand

      public int getNumberOfCommand()
    • getCommand

      public Command getCommand(String commandName)
      Returns the Command with the given name, or null if not found.
      Parameters:
      commandName -
      Returns:
    • getName

      public String getName()
      Description copied from interface: Named
      Return the name of the object.
      Specified by:
      getName in interface Named
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • size

      public int size()
      Size, i.e., the number of contained Commands.
      Returns:
    • isEmpty

      public boolean isEmpty()
    • iterator

      public Iterator<Command> iterator()
      Specified by:
      iterator in interface Iterable<Command>
    • sort

      public void sort(Comparator<? super Named> comparator)
      Sort the commands according to the Comparator given as argument.
      Parameters:
      comparator -
    • sort

      public void sort()
      Calls sort with a comparator that amounts to case-insensitive alphabetical sorting.
    • sortIgnoringCase

      public void sortIgnoringCase()
    • generateInheritanceParameters

      public void generateInheritanceParameters()
      Attempt to generate inheritance information.
    • deleteInheritanceParameters

      public void deleteInheritanceParameters()
      Deletes inheritance information, if present.
    • toElement

      Element toElement(Document doc, boolean fatRaw, boolean generateParameters, boolean generateProntoHex, boolean generateRaw)
      Description copied from class: XmlExporter
      Exports the Object to an Element.
      Specified by:
      toElement in class XmlExporter
      Parameters:
      doc - Owner Document.
      fatRaw - If generating the raw form, generate it in the so-called fat form, with one element per duration.
      generateParameters - If true, generate the parameter form.
      generateProntoHex - If true, generate the Pronto Hex form.
      generateRaw - If true, generate the raw form.
      Returns:
      newly constructed element, belonging to the doc Document.
    • addFormat

      public void addFormat(Command.CommandTextFormat format, int repeatCount)
      Applies the format argument to all Command's in the CommandSet.
      Parameters:
      format -
      repeatCount -
    • strip

      public void strip()
      Apply the strip() method to all contained Commands.