Class ExtendedSignalMapper

java.lang.Object
net.maswag.falcaun.ExtendedSignalMapper
All Implemented Interfaces:
SignalMapper

public class ExtendedSignalMapper extends Object implements SignalMapper
Class to construct pseudo signals from concrete signals
Author:
Masaki Waga <masakiwaga@gmail.com>
  • Field Details

  • Constructor Details

    • ExtendedSignalMapper

      public ExtendedSignalMapper()
      Constructs a new ExtendedSignalMapper with an empty list of signal mappers.
  • Method Details

    • apply

      public double apply(int index, IOSignalPiece<List<Double>> concreteSignal)
      Applies the signal mapper to the specified index and concrete signal.
      Specified by:
      apply in interface SignalMapper
      Parameters:
      index - the index of the signal mapper to apply
      concreteSignal - the concrete signal to apply the signal mapper to
      Returns:
      the result of applying the signal mapper
      Throws:
      IllegalArgumentException - if the given signal is not an instance of ExtendedIOSignalPiece
    • size

      public int size()
      Returns the size of the signal mapper list.
      Specified by:
      size in interface SignalMapper
      Returns:
      the size of the signal mapper list
    • parse

      public static ExtendedSignalMapper parse(String filename) throws IOException
      Parses the signal mapper from the specified file.
      Parameters:
      filename - the name of the file to parse
      Returns:
      the parsed signal mapper
      Throws:
      IOException - if an I/O error occurs
    • parse

      public static ExtendedSignalMapper parse(BufferedReader reader)
      Parses the signal mapper from the specified BufferedReader.
      Parameters:
      reader - the BufferedReader to parse
      Returns:
      the parsed signal mapper
    • parse

      public static ExtendedSignalMapper parse(List<String> mapperDefinitions)
      Parses the signal mapper from the specified list of mapper definitions.
      Parameters:
      mapperDefinitions - the list of mapper definitions to parse
      Returns:
      the parsed signal mapper
    • lineParse

      Parses a single line of the signal mapper definition.
      Parameters:
      line - the line to parse
      Returns:
      the parsed signal mapper function
    • parseSignalMapperImpl

      Parses the signal mapper definition using the specified visitor.
      Parameters:
      line - the line to parse
      visitor - the visitor to use for parsing
      Returns:
      the parsed signal mapper function