Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.wpi.cetask
Class Decomposition.Step

    java.lang.Object
      edu.wpi.cetask.Task
          edu.wpi.cetask.Decomposition.Step

Enclosing class:
  Decomposition

    public class Decomposition.Step

extends Task

Field Summary
`protected Bindings` | `bindings`
`protected TaskEngine` | `engine`

Method Summary
`boolean` | `copySlotValue(Task from, String fromSlot, String thisSlot, boolean onlyDefined)`
`void` | `deleteSlotValue(String name)` Make named slot undefined.
`protected Object` | `eval(String script, Bindings extra, String where)`
`void` | `eval(String expression, Object value, String where)`
`Object` | `eval(String expression, String where)`
`protected Boolean` | `evalCondition(CompiledScript compiled, Bindings extra, String where)`
`protected Boolean` | `evalCondition(String expression, Bindings extra, String where)`
`protected Boolean` | `evalCondition(String condition, CompiledScript compiled, String where)`
`protected Boolean` | `evalCondition(String expression, String where)`
`Decomposition` | `getDecomposition()`
`String` | `getName()`
`Object` | `getSlotValue(String name)` Return value of the named slot. Note that this method returns a Java object, but the real values are stored in JavaScript and must be converted to Java objects when returned by this method.
`boolean` | `isDefinedSlot(String name)` Test whether slot value is defined.
`void` | `setSlotValue(String name, Object value)`
`void` | `setSlotValueScript(String name, String expression, String where)` Set the value of named slot to result of evaluating given JavaScript expression.
`String` | `toString()`

Methods inherited from class edu.wpi.cetask.Task
`checkSlotValue, checkSlotValueScript, copySlotValue, copySlotValues, execute, format, getDecompositions, getExternal, getProperty, getScript, getSlotValueToString, getSuccess, getType, getWhen, isAchieved, isApplicable, isDefinedInputs, isDefinedOutputs, matches, occurred, setExternal, setSlotValue, setSuccess, setWhen, toStringVerbose`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### engine

    protected final TaskEngine engine

### bindings

    protected final Bindings bindings

Method Detail

### getName

    public String getName()

### getDecomposition

    public Decomposition getDecomposition()

### eval

    public Object eval(String expression,
                       String where)

### eval

    protected Object eval(String script,
                          Bindings extra,
                          String where)

### evalCondition

    protected Boolean evalCondition(CompiledScript compiled,
                                    Bindings extra,
                                    String where)

### getSlotValue

    public Object getSlotValue(String name)

  Description copied from class: `Task`
  Return value of the named slot.
  Note that this method returns a Java object, but the real values are stored in JavaScript and must be converted to Java objects when returned by this method. Refer to Chapter 12 of O'Reilly JavaScript guide for details of conversion, but note following subtleties here:
  - JavaScript objects and arrays (i.e., everything except for numbers, strings and booleans) convert to Java objects of "opaque" type. These values can be passed back to JavaScript, but have an unpublished API that is not intended for use by Java programs.
  - Both null and undefined in JavaScript convert to null
  Since there is no attribute for "optional" slots in CEA-2018, all input slot values must be defined before executing a task and all output slots will be defined after execution. However, a null value can be used unless a pre- or postcondition specifies otherwise.

  Overrides:
    `getSlotValue` in class `Task`
  See Also:
    `Task.isDefinedSlot(String)`, `Task.deleteSlotValue(String)`, `Task.isDefinedInputs()`, `Task.isDefinedOutputs()`

### isDefinedSlot

    public boolean isDefinedSlot(String name)

  Description copied from class: `Task`
  Test whether slot value is defined. Note if getSlotValue() returns null, isDefinedSlot() may return true or false.

  Overrides:
    `isDefinedSlot` in class `Task`
  See Also:
    `Task.getSlotValue(String)`, `Task.deleteSlotValue(String)`

### copySlotValue

    public boolean copySlotValue(Task from,
                                 String fromSlot,
                                 String thisSlot,
                                 boolean onlyDefined)

  Overrides:
    `copySlotValue` in class `Task`

### setSlotValue

    public void setSlotValue(String name,
                             Object value)

  Overrides:
    `setSlotValue` in class `Task`

### setSlotValueScript

    public void setSlotValueScript(String name,
                                   String expression,
                                   String where)

  Description copied from class: `Task`
  Set the value of named slot to result of evaluating given JavaScript expression. This method avoids issues of conversion from Java to JavaScript objects.

  Overrides:
    `setSlotValueScript` in class `Task`
  See Also:
    `Task.setSlotValue(String,Object)`

### deleteSlotValue

    public void deleteSlotValue(String name)

  Description copied from class: `Task`
  Make named slot undefined.

  Overrides:
    `deleteSlotValue` in class `Task`
  See Also:
    `Task.isDefinedSlot(String)`

### eval

    public void eval(String expression,
                     Object value,
                     String where)

### evalCondition

    protected Boolean evalCondition(String expression,
                                    String where)

### evalCondition

    protected Boolean evalCondition(String expression,
                                    Bindings extra,
                                    String where)

### evalCondition

    protected Boolean evalCondition(String condition,
                                    CompiledScript compiled,
                                    String where)

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD