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 AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> Nested classes/interfaces inherited from interface BasicSeries
BasicSeries.NaturallySequenced<K,V>, BasicSeries.TimeSeriesBuilder<K> -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final Structure1D.IndexMapper<Double> private final BinaryFunction<N> private ColourDataprivate final LongToNumberMap<N> private final Structure1D.IndexMapper<K> private StringFields inherited from interface BasicSeries
CALENDAR, CALENDAR_DATE, DATE, INSTANT, LOCAL_DATE, LOCAL_DATE_TIME, LOCAL_TIME, OFFSET_DATE_TIME, ZONED_DATE_TIME -
Constructor Summary
ConstructorsConstructorDescriptionMappedIndexSeries(PlainArray.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> voidcomplete()Using the natural sequencing as the key incrementor.doubledoubleValue(K key) entrySet()firstKey()(package private) BinaryFunction<N> getName()lastKey()mapper()private LongToNumberMap<N> A "hack" that will create a new empty delegateLongToNumberMapinstance.nextKey()doubleWill only work if values are types as Double.resample(UnaryOperator<K> keyTranslator) voidsetColour(ColourData colour) voidWill step (increment) the key given to the next in the natural sequence.(package private) static longtoIndex(double key) (package private) static doubletoKey(long index) toString()Methods inherited from class AbstractMap
clear, clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, remove, size, valuesMethods inherited from interface BasicSeries
complete, put, putAll, resampleMethods inherited from interface Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, getOrDefault, hashCode, isEmpty, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, sizeMethods inherited from interface SequencedMap
firstEntry, lastEntry, pollFirstEntry, pollLastEntry, sequencedEntrySet, sequencedKeySet, sequencedValues
-
Field Details
-
MAPPER
-
myAccumulator
-
myColour
-
myDelegate
-
myMapper
-
myName
-
-
Constructor Details
-
MappedIndexSeries
MappedIndexSeries(Structure1D.IndexMapper<K> indexMapper, LongToNumberMap<N> delegate, BinaryFunction<N> accumulator) -
MappedIndexSeries
MappedIndexSeries(PlainArray.Factory<N, ?> denseArrayFactory, Structure1D.IndexMapper<K> indexMapper, BinaryFunction<N> accumulator)
-
-
Method Details
-
toIndex
static long toIndex(double key) -
toKey
static double toKey(long index) -
asPrimitive
- Specified by:
asPrimitivein interfaceBasicSeries<K extends Comparable<? super K>, N extends Comparable<N>>
-
colour
- Specified by:
colourin interfaceBasicSeries<K extends Comparable<? super K>, N extends Comparable<N>>
-
comparator
- Specified by:
comparatorin interfaceSortedMap<K extends Comparable<? super K>, N extends Comparable<N>>
-
complete
public void complete()Description copied from interface:BasicSeries.NaturallySequencedUsing the natural sequencing as the key incrementor.- Specified by:
completein interfaceBasicSeries.NaturallySequenced<K extends Comparable<? super K>, N extends Comparable<N>>- See Also:
-
doubleValue
- Specified by:
doubleValuein interfaceBasicSeries<K extends Comparable<? super K>, N extends Comparable<N>>
-
entrySet
- Specified by:
entrySetin interfaceMap<K extends Comparable<? super K>, N extends Comparable<N>>- Specified by:
entrySetin interfaceSortedMap<K extends Comparable<? super K>, N extends Comparable<N>>- Specified by:
entrySetin classAbstractMap<K extends Comparable<? super K>, N extends Comparable<N>>
-
firstKey
- Specified by:
firstKeyin interfaceSortedMap<K extends Comparable<? super K>, N extends Comparable<N>>
-
firstValue
- Specified by:
firstValuein interfaceBasicSeries<K extends Comparable<? super K>, N extends Comparable<N>>
-
get
- Specified by:
getin interfaceBasicSeries<K extends Comparable<? super K>, N extends Comparable<N>>
-
get
- Specified by:
getin interfaceBasicSeries<K extends Comparable<? super K>, N extends Comparable<N>>- Specified by:
getin interfaceMap<K extends Comparable<? super K>, N extends Comparable<N>>- Overrides:
getin classAbstractMap<K extends Comparable<? super K>, N extends Comparable<N>>
-
getColour
- Specified by:
getColourin interfaceBasicSeries<K extends Comparable<? super K>, N extends Comparable<N>>
-
getName
- Specified by:
getNamein interfaceBasicSeries<K extends Comparable<? super K>, N extends Comparable<N>>
-
headMap
- Specified by:
headMapin interfaceSortedMap<K extends Comparable<? super K>, N extends Comparable<N>>
-
lastKey
- Specified by:
lastKeyin interfaceSortedMap<K extends Comparable<? super K>, N extends Comparable<N>>
-
lastValue
- Specified by:
lastValuein interfaceBasicSeries<K extends Comparable<? super K>, N extends Comparable<N>>
-
mapper
-
name
- Specified by:
namein interfaceBasicSeries<K extends Comparable<? super K>, N extends Comparable<N>>
-
nextKey
- Specified by:
nextKeyin interfaceBasicSeries.NaturallySequenced<K extends Comparable<? super K>, N extends Comparable<N>>- Returns:
- The next, after the
SortedMap.lastKey(), key.
-
put
Description copied from interface:BasicSeriesWill only work if values are types as Double.- Specified by:
putin interfaceBasicSeries<K extends Comparable<? super K>, N extends Comparable<N>>- See Also:
-
put
- Specified by:
putin interfaceMap<K extends Comparable<? super K>, N extends Comparable<N>>- Overrides:
putin classAbstractMap<K extends Comparable<? super K>, N extends Comparable<N>>
-
resample
- Specified by:
resamplein interfaceBasicSeries<K extends Comparable<? super K>, N extends Comparable<N>>
-
setColour
- Specified by:
setColourin interfaceBasicSeries<K extends Comparable<? super K>, N extends Comparable<N>>
-
setName
- Specified by:
setNamein interfaceBasicSeries<K extends Comparable<? super K>, N extends Comparable<N>>
-
step
Description copied from interface:BasicSeries.NaturallySequencedWill step (increment) the key given to the next in the natural sequence.- Specified by:
stepin interfaceBasicSeries.NaturallySequenced<K extends Comparable<? super K>, N extends Comparable<N>>
-
subMap
- Specified by:
subMapin interfaceSortedMap<K extends Comparable<? super K>, N extends Comparable<N>>
-
tailMap
- Specified by:
tailMapin interfaceSortedMap<K extends Comparable<? super K>, N extends Comparable<N>>
-
toString
- Overrides:
toStringin classAbstractMap<K extends Comparable<? super K>, N extends Comparable<N>>
-
newDelegateInstance
A "hack" that will create a new empty delegateLongToNumberMapinstance. -
getAccumulator
BinaryFunction<N> getAccumulator()
-