Class MetaCommand

All Implemented Interfaces:

public class MetaCommand extends NameDescription
The MetaCommand is the base type for a tele-command.

The rules for MetaCommand inheritance as follows:

  • A MetaCommand may extend another using the BaseMetaCommand element
  • BaseMetaCommands that form loops are illegal
  • Its CommandContainer is only inherited if the BaseContainer is explicitly set between the child and parent.
  • The same rules apply to MetaCommand/CommandContainer inheritance as described in SequenceContainer/BaseContainer.

Specific rules by element and attribute are:

  • BaseMetaCommand/ArgumentAssignment Child’s content will override parent’s content if present, otherwise child gets parent’s content if it is specified.
  • If argument is the same name, it overrides the parent’s ArgumentAssignment.
  • ArgumentList Child’s content is appended to parent’s content if present
  • CommandContainer Special Case: inherited like other containers if CommandContainer/BaseContainer set. Otherwise it is not inherited.
  • TransmissionConstraintList Child’s content prefixed to parent’s content if present
  • DefaultSignificance Child’s content will override parent’s content if present, otherwise child gets parent’s content if specified
  • VerifierSet Child’s content prefixed to parent’s content if present but: - Same verifiers are overridden by the child
See Also:
  • Constructor Details

    • MetaCommand

      public MetaCommand(String name)
  • Method Details

    • setAbstract

      public void setAbstract(boolean a)
      Set the command as abstract or non abstract. Abstract commands cannot be instantiated
      a -
    • isAbstract

      public boolean isAbstract()
    • setCommandContainer

      public void setCommandContainer(CommandContainer mcc)
    • getCommandContainer

      public CommandContainer getCommandContainer()
    • setBaseMetaCommand

      public void setBaseMetaCommand(MetaCommand mc)
    • getBaseMetaCommand

      public MetaCommand getBaseMetaCommand()
    • getArgumentAssignmentList

      public List<ArgumentAssignment> getArgumentAssignmentList()
      returns the argument assignment list in relation to the inheritance - this is the list of arguments of the parent(s) which are assigned when the inheritance takes place returns null if there is no such argument
    • getArgumentList

      public List<Argument> getArgumentList()
      returns the list of arguments of this command can be empty if the command doesn't have arguments
    • getEffectiveArgumentList

      public List<Argument> getEffectiveArgumentList()
      returns the list of all arguments including those inherited from the parent
    • getEffectiveArgumentAssignmentList

      public List<ArgumentAssignment> getEffectiveArgumentAssignmentList()
    • getArgument

      public Argument getArgument(String argumentName)
      returns an argument based on name or null if it doesn't exist

      The argument is only looked up in the current meta command, not in its parent.

      argumentName -
    • getEffectiveArgument

      public Argument getEffectiveArgument(String argumentName)
      Same as getArgument(String) but looks up the argument also in the parent
    • addArgument

      public void addArgument(Argument arg)
      Adds an argument to the command.
      arg - - the argument to be added
    • addTransmissionConstrain

      public void addTransmissionConstrain(TransmissionConstraint constraint)
    • getTransmissionConstraintList

      public List<TransmissionConstraint> getTransmissionConstraintList()
      the list of transmission constraints (can be empty but not null)
    • addArgumentAssignment

      public void addArgumentAssignment(ArgumentAssignment aa)
    • hasTransmissionConstraints

      public boolean hasTransmissionConstraints()
    • getEffectiveDefaultSignificance

      public Significance getEffectiveDefaultSignificance()
      returns the command significance either directly defined or inherited from the parent

      Returns null of no significance is attached to the command

    • getDefaultSignificance

      public Significance getDefaultSignificance()
    • setDefaultSignificance

      public void setDefaultSignificance(Significance defaultSignificance)
    • addVerifier

      public void addVerifier(CommandVerifier cmdVerifier)
    • hasCommandVerifiers

      public boolean hasCommandVerifiers()
    • getCommandVerifiers

      public List<CommandVerifier> getCommandVerifiers()
    • print

      public void print(PrintStream out)
    • setArgumentAssignmentList

      public void setArgumentAssignmentList(List<ArgumentAssignment> argumentAssignmentList)