Package org.ojalgo.series
Class MappedIndexSeries<K extends Comparable<? super K>,N extends Comparable<N>>
java.lang.Object
java.util.AbstractMap<K,N>
org.ojalgo.series.MappedIndexSeries<K,N>
- All Implemented Interfaces:
Map<K,
,N> SequencedMap<K,
,N> SortedMap<K,
,N> BasicSeries<K,
,N> BasicSeries.NaturallySequenced<K,
N>
final class MappedIndexSeries<K extends Comparable<? super K>,N extends Comparable<N>>
extends AbstractMap<K,N>
implements BasicSeries.NaturallySequenced<K,N>
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> Nested classes/interfaces inherited from interface org.ojalgo.series.BasicSeries
BasicSeries.NaturallySequenced<K extends Comparable<? super K>,
V extends Comparable<V>>, BasicSeries.TimeSeriesBuilder<K extends Comparable<? super K>> -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final Structure1D.IndexMapper
<Double> private final BinaryFunction
<N> private ColourData
private final LongToNumberMap
<N> private final Structure1D.IndexMapper
<K> private String
Fields inherited from interface org.ojalgo.series.BasicSeries
CALENDAR, CALENDAR_DATE, DATE, INSTANT, LOCAL_DATE, LOCAL_DATE_TIME, LOCAL_TIME, OFFSET_DATE_TIME, ZONED_DATE_TIME
-
Constructor Summary
ConstructorsConstructorDescriptionMappedIndexSeries
(DenseArray.Factory<N> denseArrayFactory, Structure1D.IndexMapper<K> indexMapper, BinaryFunction<N> accumulator) MappedIndexSeries
(Structure1D.IndexMapper<K> indexMapper, LongToNumberMap<N> delegate, BinaryFunction<N> accumulator) -
Method Summary
Modifier and TypeMethodDescriptioncolour
(ColourData colour) Comparator
<? super K> void
complete()
Using the natural sequencing as the key incrementor.double
doubleValue
(K key) entrySet()
firstKey()
(package private) BinaryFunction
<N> getName()
lastKey()
mapper()
private LongToNumberMap
<N> A "hack" that will create a new empty delegateLongToNumberMap
instance.nextKey()
double
Will only work if values are types as Double.resample
(UnaryOperator<K> keyTranslator) void
setColour
(ColourData colour) void
Will step (increment) the key given to the next in the natural sequence.(package private) static long
toIndex
(double key) (package private) static double
toKey
(long index) toString()
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, remove, size, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.ojalgo.series.BasicSeries
complete, put, putAll, resample
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, getOrDefault, hashCode, isEmpty, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size
Methods inherited from interface java.util.SequencedMap
firstEntry, lastEntry, pollFirstEntry, pollLastEntry, sequencedEntrySet, sequencedKeySet, sequencedValues
-
Field Details
-
MAPPER
-
myAccumulator
-
myColour
-
myDelegate
-
myMapper
-
myName
-
-
Constructor Details
-
MappedIndexSeries
MappedIndexSeries(DenseArray.Factory<N> denseArrayFactory, Structure1D.IndexMapper<K> indexMapper, BinaryFunction<N> accumulator) -
MappedIndexSeries
MappedIndexSeries(Structure1D.IndexMapper<K> indexMapper, LongToNumberMap<N> delegate, BinaryFunction<N> accumulator)
-
-
Method Details
-
toIndex
static long toIndex(double key) -
toKey
static double toKey(long index) -
asPrimitive
- Specified by:
asPrimitive
in interfaceBasicSeries<K extends Comparable<? super K>,
N extends Comparable<N>>
-
colour
- Specified by:
colour
in interfaceBasicSeries<K extends Comparable<? super K>,
N extends Comparable<N>>
-
comparator
- Specified by:
comparator
in interfaceSortedMap<K extends Comparable<? super K>,
N extends Comparable<N>>
-
complete
public void complete()Description copied from interface:BasicSeries.NaturallySequenced
Using the natural sequencing as the key incrementor.- Specified by:
complete
in interfaceBasicSeries.NaturallySequenced<K extends Comparable<? super K>,
N extends Comparable<N>> - See Also:
-
doubleValue
- Specified by:
doubleValue
in interfaceBasicSeries<K extends Comparable<? super K>,
N extends Comparable<N>>
-
entrySet
- Specified by:
entrySet
in interfaceMap<K extends Comparable<? super K>,
N extends Comparable<N>> - Specified by:
entrySet
in interfaceSortedMap<K extends Comparable<? super K>,
N extends Comparable<N>> - Specified by:
entrySet
in classAbstractMap<K extends Comparable<? super K>,
N extends Comparable<N>>
-
firstKey
- Specified by:
firstKey
in interfaceSortedMap<K extends Comparable<? super K>,
N extends Comparable<N>>
-
firstValue
- Specified by:
firstValue
in interfaceBasicSeries<K extends Comparable<? super K>,
N extends Comparable<N>>
-
get
- Specified by:
get
in interfaceBasicSeries<K extends Comparable<? super K>,
N extends Comparable<N>>
-
get
- Specified by:
get
in interfaceBasicSeries<K extends Comparable<? super K>,
N extends Comparable<N>> - Specified by:
get
in interfaceMap<K extends Comparable<? super K>,
N extends Comparable<N>> - Overrides:
get
in classAbstractMap<K extends Comparable<? super K>,
N extends Comparable<N>>
-
getColour
- Specified by:
getColour
in interfaceBasicSeries<K extends Comparable<? super K>,
N extends Comparable<N>>
-
getName
- Specified by:
getName
in interfaceBasicSeries<K extends Comparable<? super K>,
N extends Comparable<N>>
-
headMap
- Specified by:
headMap
in interfaceSortedMap<K extends Comparable<? super K>,
N extends Comparable<N>>
-
lastKey
- Specified by:
lastKey
in interfaceSortedMap<K extends Comparable<? super K>,
N extends Comparable<N>>
-
lastValue
- Specified by:
lastValue
in interfaceBasicSeries<K extends Comparable<? super K>,
N extends Comparable<N>>
-
mapper
-
name
- Specified by:
name
in interfaceBasicSeries<K extends Comparable<? super K>,
N extends Comparable<N>>
-
nextKey
- Specified by:
nextKey
in interfaceBasicSeries.NaturallySequenced<K extends Comparable<? super K>,
N extends Comparable<N>> - Returns:
- The next, after the
SortedMap.lastKey()
, key.
-
put
Description copied from interface:BasicSeries
Will only work if values are types as Double.- Specified by:
put
in interfaceBasicSeries<K extends Comparable<? super K>,
N extends Comparable<N>> - See Also:
-
put
- Specified by:
put
in interfaceMap<K extends Comparable<? super K>,
N extends Comparable<N>> - Overrides:
put
in classAbstractMap<K extends Comparable<? super K>,
N extends Comparable<N>>
-
resample
- Specified by:
resample
in interfaceBasicSeries<K extends Comparable<? super K>,
N extends Comparable<N>>
-
setColour
- Specified by:
setColour
in interfaceBasicSeries<K extends Comparable<? super K>,
N extends Comparable<N>>
-
setName
- Specified by:
setName
in interfaceBasicSeries<K extends Comparable<? super K>,
N extends Comparable<N>>
-
step
Description copied from interface:BasicSeries.NaturallySequenced
Will step (increment) the key given to the next in the natural sequence.- Specified by:
step
in interfaceBasicSeries.NaturallySequenced<K extends Comparable<? super K>,
N extends Comparable<N>>
-
subMap
- Specified by:
subMap
in interfaceSortedMap<K extends Comparable<? super K>,
N extends Comparable<N>>
-
tailMap
- Specified by:
tailMap
in interfaceSortedMap<K extends Comparable<? super K>,
N extends Comparable<N>>
-
toString
- Overrides:
toString
in classAbstractMap<K extends Comparable<? super K>,
N extends Comparable<N>>
-
newDelegateInstance
A "hack" that will create a new empty delegateLongToNumberMap
instance. -
getAccumulator
BinaryFunction<N> getAccumulator()
-