Package net.maswag.falcaun
Class ExtendedSignalMapper
java.lang.Object
net.maswag.falcaun.ExtendedSignalMapper
- All Implemented Interfaces:
SignalMapper
Class to construct pseudo signals from concrete signals
- Author:
- Masaki Waga <masakiwaga@gmail.com>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new ExtendedSignalMapper with an empty list of signal mappers. -
Method Summary
Modifier and TypeMethodDescriptiondoubleapply(int index, IOSignalPiece<List<Double>> concreteSignal) Applies the signal mapper to the specified index and concrete signal.Parses a single line of the signal mapper definition.static ExtendedSignalMapperparse(BufferedReader reader) Parses the signal mapper from the specified BufferedReader.static ExtendedSignalMapperParses the signal mapper from the specified file.static ExtendedSignalMapperParses the signal mapper from the specified list of mapper definitions.parseSignalMapperImpl(String line, ExtendedSignalMapperVisitor<Function<ExtendedIOSignalPiece<List<Double>>, List<Double>>> visitor) Parses the signal mapper definition using the specified visitor.intsize()Returns the size of the signal mapper list.
-
Field Details
-
sigMap
-
-
Constructor Details
-
ExtendedSignalMapper
public ExtendedSignalMapper()Constructs a new ExtendedSignalMapper with an empty list of signal mappers.
-
-
Method Details
-
apply
Applies the signal mapper to the specified index and concrete signal.- Specified by:
applyin interfaceSignalMapper- Parameters:
index- the index of the signal mapper to applyconcreteSignal- 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:
sizein interfaceSignalMapper- Returns:
- the size of the signal mapper list
-
parse
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
Parses the signal mapper from the specified BufferedReader.- Parameters:
reader- the BufferedReader to parse- Returns:
- the parsed signal mapper
-
parse
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
private static Function<ExtendedIOSignalPiece<List<Double>>,List<Double>> parseSignalMapperImpl(String line, ExtendedSignalMapperVisitor<Function<ExtendedIOSignalPiece<List<Double>>, List<Double>>> visitor) Parses the signal mapper definition using the specified visitor.- Parameters:
line- the line to parsevisitor- the visitor to use for parsing- Returns:
- the parsed signal mapper function
-