Class EventSpec

java.lang.Object
edu.tufts.hrilab.action.EventSpec
All Implemented Interfaces:
Serializable

public final class EventSpec extends Object implements Serializable
An event specification is a description of a step (event) in an action script. Some events are realized as actions, and other events are controls (e.g. if, while). The EventSpec class is designed to parse the String that describes the step and provide simple accessors to the command (or control) and the list of arguments. This class is immutable.
See Also:
  • Constructor Details

    • EventSpec

      @Deprecated public EventSpec(EventSpec.EventType eventType, String eventString)
      Deprecated.
      Use the Builder or constructor that takes in a Predicate.
      Parameters:
      eventType -
      eventString -
    • EventSpec

      public EventSpec(Predicate eventPredicate)
      Build ACTION or GOAL EventSpec from Predicate representation (i.e., action(actor,args)). TODO: generalize this method to work for non-ACTION types, using the same semantics that Goal expects.
      Parameters:
      eventPredicate -
  • Method Details

    • getType

      public EventSpec.EventType getType()
      Get EventType.
      Returns:
      type
    • getPredicateForm

      public Predicate getPredicateForm()
    • getCommand

      public String getCommand()
      Get command.
      Returns:
      command
    • getActor

      public String getActor()
    • getInputArgs

      public List<String> getInputArgs()
      Get input arguments.
      Returns:
      shallow copy of arguments
    • getReturnArgs

      public List<String> getReturnArgs()
      Get return arguments.
      Returns:
      shallow copy of arguments
    • getAllArgs

      public List<String> getAllArgs()
      Get all arguments. Input args followed by return args.
      Returns:
      shallow copy of arguments
    • toString

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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object