Package org.ojalgo.structure
Class StructureAnyD.ReferenceMapper
java.lang.Object
org.ojalgo.structure.StructureAnyD.ReferenceMapper
- All Implemented Interfaces:
Structure1D.IndexMapper<Object[]>
- Enclosing interface:
StructureAnyD
public static class StructureAnyD.ReferenceMapper
extends Object
implements Structure1D.IndexMapper<Object[]>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Structure1D.IndexMapper<Object>[]
private final long[]
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ReferenceMapper
(StructureAnyD structure, Structure1D.IndexMapper<Object>[] mappers) -
Method Summary
Modifier and TypeMethodDescription<T> long
toIndex
(int dim, T key) long
For each key (any instance of that type) there is a corresponding index value – 1 or more key instances will be mapped to each index value.<T> T
toKey
(int dim, long index) Object[]
toKey
(long index) In most cases it should be safe to assume that the input index value is valid (matching what would be created byStructure1D.IndexMapper.toIndex(Object)
).<T extends Comparable<? super T>>
TtoKey
(long index, int dim) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ojalgo.structure.Structure1D.IndexMapper
next, previous
-
Field Details
-
myMappers
-
myStructure
private final long[] myStructure
-
-
Constructor Details
-
ReferenceMapper
-
-
Method Details
-
toIndex
public <T> long toIndex(int dim, T key) -
toIndex
Description copied from interface:Structure1D.IndexMapper
For each key (any instance of that type) there is a corresponding index value – 1 or more key instances will be mapped to each index value.- Specified by:
toIndex
in interfaceStructure1D.IndexMapper<Object[]>
-
toKey
public <T> T toKey(int dim, long index) -
toKey
Description copied from interface:Structure1D.IndexMapper
In most cases it should be safe to assume that the input index value is valid (matching what would be created byStructure1D.IndexMapper.toIndex(Object)
).- Specified by:
toKey
in interfaceStructure1D.IndexMapper<Object[]>
-
toKey
-