Package net.maswag.falcaun
Class InputMapper
java.lang.Object
net.maswag.falcaun.InputMapper
- All Implemented Interfaces:
Iterable<Map<Character,,Double>> Collection<Map<Character,,Double>> List<Map<Character,Double>>
A class that represents a mapping from characters to double values.
This class implements List<Map<Character, Double>> and can be constructed
from a List<List<Double>>, similar to how InputMapperReader works.
The InputMapper provides functionality to create a list of character-to-double mappings from a list of lists of double values. Each inner list in the input is converted to a map where characters (starting from 'a') are assigned to the double values.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateInputMapper(ArrayList<Map<Character, Double>> delegate) Private constructor used by factory methods. -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, Collection<? extends Map<Character, Double>> c) booleanaddAll(Collection<? extends Map<Character, Double>> c) voidclear()booleanbooleancontainsAll(Collection<?> c) voidstatic InputMapperfromMappings(List<Map<Character, Double>> mappings) Creates an InputMapper from an existing List<Map<Character, Double>>.get(int index) intbooleanisEmpty()iterator()int@NotNull ListIterator<Map<Character,Double>> @NotNull ListIterator<Map<Character,Double>> listIterator(int index) static InputMapperCreates an InputMapper from a List<List<Double>>.static InputMappermakeWithCustomChars(List<List<Double>> data, char[] charList) Creates an InputMapper from a List<List<Double>> with custom starting characters.remove(int index) booleanbooleanremoveAll(Collection<?> c) booleanvoidreplaceAll(@NotNull UnaryOperator<Map<Character, Double>> operator) booleanretainAll(Collection<?> c) intsize()voidsort(Comparator<? super Map<Character, Double>> c) @NotNull Spliterator<Map<Character,Double>> stream()subList(int fromIndex, int toIndex) Object @NotNull []toArray()<T> T[]toArray(@NotNull IntFunction<T[]> generator) <T> T @NotNull []toArray(T[] a)
-
Field Details
-
delegate
-
-
Constructor Details
-
InputMapper
Private constructor used by factory methods.- Parameters:
delegate- The ArrayList to delegate to
-
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty() -
contains
-
iterator
-
toArray
-
toArray
public <T> T @NotNull [] toArray(T[] a) -
add
-
remove
-
containsAll
- Specified by:
containsAllin interfaceCollection<Map<Character,Double>> - Specified by:
containsAllin interfaceList<Map<Character,Double>>
-
addAll
-
addAll
-
removeAll
-
retainAll
-
clear
public void clear() -
get
-
set
-
add
-
remove
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<Map<Character,Double>>
-
listIterator
- Specified by:
listIteratorin interfaceList<Map<Character,Double>>
-
listIterator
- Specified by:
listIteratorin interfaceList<Map<Character,Double>>
-
subList
-
replaceAll
- Specified by:
replaceAllin interfaceList<Map<Character,Double>>
-
sort
-
spliterator
- Specified by:
spliteratorin interfaceCollection<Map<Character,Double>> - Specified by:
spliteratorin interfaceIterable<Map<Character,Double>> - Specified by:
spliteratorin interfaceList<Map<Character,Double>>
-
removeIf
- Specified by:
removeIfin interfaceCollection<Map<Character,Double>>
-
stream
- Specified by:
streamin interfaceCollection<Map<Character,Double>>
-
parallelStream
- Specified by:
parallelStreamin interfaceCollection<Map<Character,Double>>
-
forEach
-
make
Creates an InputMapper from a List<List<Double>>. This is a static factory method similar to InputMapperReader.make(). Each inner list is converted to a map where characters (starting from 'a') are assigned to the double values.- Parameters:
data- The list of lists of double values to convert- Returns:
- A new InputMapper instance
-
makeWithCustomChars
Creates an InputMapper from a List<List<Double>> with custom starting characters. Each inner list is converted to a map where characters (starting from the specified characters) are assigned to the double values.- Parameters:
data- The list of lists of double values to convertcharList- The array of starting characters for each list- Returns:
- A new InputMapper instance
-
fromMappings
Creates an InputMapper from an existing List<Map<Character, Double>>. This is a static factory method to create an InputMapper from an existing mapping.- Parameters:
mappings- The list of character-to-double mappings- Returns:
- A new InputMapper instance
-
toArray
- Specified by:
toArrayin interfaceCollection<Map<Character,Double>>
-