Class Remote

All Implemented Interfaces:
Serializable, Iterable<CommandSet>, Named

public final class Remote extends XmlExporter implements Named, Iterable<CommandSet>
This class describes a remote in Girr. A Remote is essentially an abstraction of a hand-held "clicker" for controlling one device. It has a name for identification, and a number of comment-like text fields. Most importantly, it has a dictionary of CommandSets, indexed by their names. The CommandSets contain Commands, having names that are unique within their CommandSet. Note that Commands with the same name can be present in different CommandSets. For example, some TVs have both an RC5 and an RC6 Command set, both containing a command "power", but these are or course different.
See Also:
  • Constructor Details

  • Method Details

    • toElement

      public 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.
    • sort

      public void sort(Comparator<? super Named> comparator)
      Apply the sort function to all contained CommandSets.
      Parameters:
      comparator -
    • sortCommands

      public void sortCommands(Comparator<? super Named> comparator)
    • sortCommands

      public void sortCommands()
    • sortCommandsIgnoringCase

      public void sortCommandsIgnoringCase()
    • sort

      public void sort()
    • sortIgnoringCase

      public void sortIgnoringCase()
    • normalize

      public void normalize()
      Replaces all CommandSets with a single one, containing all the commands of the original CommandSets. Note that only one commend with a particular name is present after this operation, so information may be lost.
    • addFormat

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

      public boolean hasThisProtocol(String protocolName) throws org.harctoolbox.irp.IrpException, org.harctoolbox.ircore.IrCoreException
      Returns true if and only if all contained commands has the protocol in the argument.
      Parameters:
      protocolName -
      Returns:
      Throws:
      org.harctoolbox.irp.IrpException
      org.harctoolbox.ircore.IrCoreException
    • containsThisProtocol

      public boolean containsThisProtocol(String protocolName) throws org.harctoolbox.irp.IrpException, org.harctoolbox.ircore.IrCoreException
      Returns true if and only if at least one contained commands has the protocol in the argument.
      Parameters:
      protocolName -
      Returns:
      Throws:
      org.harctoolbox.irp.IrpException
      org.harctoolbox.ircore.IrCoreException
    • getMetaData

      public Remote.MetaData getMetaData()
      Returns:
      the metaData
    • getName

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

      public void setName(String name)
    • getDisplayName

      public String getDisplayName()
      Returns:
      displayName of the Remote.
    • getComment

      public String getComment()
      Returns:
      the comment
    • getNumberOfCommands

      public int getNumberOfCommands()
      Deprecated.
      Loop the CommandSets instead.
      Returns:
    • getCommands

      public Collection<Command> getCommands()
      Deprecated.
      Loop the CommandSets instead.
      Returns all commands contained. If there are several CommandSets, the index names will be two part: commandSet : command.
      Returns:
      the commands
    • getCommand

      public List<Command> getCommand(String name)
      Deprecated.
      Loop the CommandSets instead.
      Parameters:
      name -
      Returns:
    • getApplicationParameters

      public Map<String,Map<String,String>> getApplicationParameters()
      Returns:
      the applicationParameters
    • getManufacturer

      public String getManufacturer()
      Returns:
      the manufacturer
    • getModel

      public String getModel()
      Returns:
      the model
    • getDeviceClass

      public String getDeviceClass()
      Returns:
      the deviceClass
    • getRemoteName

      public String getRemoteName()
      Returns:
      the remoteName
    • getAdminData

      AdminData getAdminData()
    • getFormattedAdminData

      public String getFormattedAdminData()
    • getAllNotes

      Map<String,String> getAllNotes()
      Returns:
      the notes
    • getNotes

      public String getNotes()
      Returns:
      the notes
    • getNotes

      public String getNotes(String lang)
      Parameters:
      lang -
      Returns:
      the notes
    • setNotes

      public void setNotes(String lang, String string)
    • setNotes

      public void setNotes(String string)
    • setComment

      void setComment(String comment)
    • checkForParameters

      public void checkForParameters() throws org.harctoolbox.irp.IrpException, org.harctoolbox.ircore.IrCoreException
      Throws:
      org.harctoolbox.irp.IrpException
      org.harctoolbox.ircore.IrCoreException
    • iterator

      public Iterator<CommandSet> iterator()
      Specified by:
      iterator in interface Iterable<CommandSet>
    • getCommandSets

      public Map<String,CommandSet> getCommandSets()
    • getCommandSet

      public CommandSet getCommandSet(String name)
    • getCommand

      public Command getCommand(String commandSetName, String name)
    • strip

      public void strip()
      Apply the strip function to all the CommandSets.