org.anduril.runtime

ComponentSkeleton

abstract class ComponentSkeleton extends AnyRef

Base class for Anduril components written in Scala. The class provides access to command file properties, including parameters, input and output ports, and metadata.

Components need to define the run method that implements the functionality of the component and returns a status code that indicates success or failure. It is convenient to define the component as a Scala singleton object.

In the following example component, we first fetch the values of two parameters (one string and one double). We validate that param1 starts with "x" and that param2 is greater than 5. We fetch file names of an input port and an output port and then do the processing (not shown). Upon successful execution, the error code ErrorCode.OK is returned.

import org.anduril.runtime.{ComponentSkeleton,ErrorCode}
object TestComponent extends ComponentSkeleton {
    override def run(): ErrorCode = {
        val param1 = param("param1", _.matches("x.*"))
        val param2 = paramD("param2", _ > 5)
        val input1 = input("input1")
        val output1 = output("output1")
        // Process
        ErrorCode.OK
    }
}
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ComponentSkeleton
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ComponentSkeleton()

Abstract Value Members

  1. abstract def run(): ErrorCode

    Perform the actions of the component.

    Perform the actions of the component. This method is implemented by concrete components.

    returns

    Exit status that indicates whether execution was successful (ErrorCode.OK) or an error occurred. For errors, various error codes are available, including a generic error (ErrorCode.ERROR).

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  8. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  11. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  12. def getCommandFile(): CommandFile

    Return the command file object that contains values for parameters, ports and metadata.

    Return the command file object that contains values for parameters, ports and metadata. It is usually not necessary to directly access this object.

  13. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  14. def input(inPortName: String): File

    Return the filename of given input port.

    Return the filename of given input port. For array data types, this returns the directory that contains the array.

    inPortName

    Name of input port.

    returns

    The filename, or null if the port doesn't exist or is not connected.

  15. def inputDefined(inPortName: String): Boolean

    Return true if the input port exists, it is connected and the input file exists.

    Return true if the input port exists, it is connected and the input file exists.

    inPortName

    Name of input port.

  16. def inputOpt(inPortName: String): Option[File]

    Return the filename of given input port, or None if the port doesn't exist or is not connected.

    Return the filename of given input port, or None if the port doesn't exist or is not connected. For array data types, this returns the directory that contains the array.

    inPortName

    Name of input port.

    returns

    The filename, or None if the port doesn't exist or is not connected.

  17. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  18. def main(args: Array[String]): Unit

    Main entry point for the component.

    Main entry point for the component. Usually not called manually.

    args

    Command line arguments. The first argument must be a path to the command file.

  19. def metadata(metadataName: String): String

    Return a metadata value.

    Return a metadata value. This is the contents of the metadata.NAME line, where NAME is the metadata name given.

  20. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  23. def output(outPortName: String): File

    Return the filename of given output port.

    Return the filename of given output port. For array data types, this returns the directory that contains the array.

    outPortName

    Name of output port.

    returns

    The filename, or null if the port doesn't exist or is not connected.

  24. def param(paramName: String, validator: (String) ⇒ Boolean = null): String

    Return the value of given parameter as a string.

    Return the value of given parameter as a string. Return null if the parameter does not exist.

    paramName

    Name of parameter.

    validator

    If non-null, this is a function that checks the value of the parameter and returns true if the value is valid. If the function returns false, execution of the component immediately halts and a message is printed to the error log.

  25. def paramB(paramName: String): Boolean

    Return the value of given parameter as a boolean.

    Return the value of given parameter as a boolean.

    paramName

    Name of parameter.

    Exceptions thrown
    IllegalArgumentException

    If the parameter has no value or is not a valid boolean.

  26. def paramD(paramName: String, validator: (Double) ⇒ Boolean = null): Double

    Return the value of given parameter as a double.

    Return the value of given parameter as a double.

    paramName

    Name of parameter.

    validator

    If non-null, this is a function that checks the value of the parameter and returns true if the value is valid. If the function returns false, execution of the component immediately halts and a message is printed to the error log.

    Exceptions thrown
    IllegalArgumentException

    If the parameter has no value.

    NumberFormatException

    If the value is not a legal double.

  27. def paramI(paramName: String, validator: (Int) ⇒ Boolean = null): Int

    Return the value of given parameter as an integer.

    Return the value of given parameter as an integer.

    paramName

    Name of parameter.

    validator

    If non-null, this is a function that checks the value of the parameter and returns true if the value is valid. If the function returns false, execution of the component immediately halts and a message is printed to the error log.

    Exceptions thrown
    IllegalArgumentException

    If the parameter has no value.

    NumberFormatException

    If the value is not a legal integer.

  28. def readArrayInput(inPortName: String): ArrayIndex

    Read the array index file of given array input port.

    Read the array index file of given array input port.

    Exceptions thrown
    IllegalArgumentException

    If the input port is empty.

  29. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  30. def tempDir(): File

    Returns a folder that may be used for temporary intermediates of the component instance.

    Returns a folder that may be used for temporary intermediates of the component instance. This folder is automatically created by this method and it is removed by the hosting engine after the execution of the instance.

  31. def toString(): String

    Definition Classes
    AnyRef → Any
  32. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  33. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  34. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  35. def writeArrayOutput(index: ArrayIndex, outPortName: String): Unit

    Write the array index to an output array port.

    Write the array index to an output array port.

    index

    Array index.

  36. def writeError(message: String): Unit

    Write a message to error stream.

  37. def writeLog(message: String): Unit

    Write a message to log stream.

Inherited from AnyRef

Inherited from Any

Ungrouped