Package org.ojalgo.structure
Class StructureAnyD.ReferenceMapper
- java.lang.Object
-
- org.ojalgo.structure.StructureAnyD.ReferenceMapper
-
- All Implemented Interfaces:
Structure1D.IndexMapper<java.lang.Object[]>
- Enclosing interface:
- StructureAnyD
public static class StructureAnyD.ReferenceMapper extends java.lang.Object implements Structure1D.IndexMapper<java.lang.Object[]>
-
-
Field Summary
Fields Modifier and Type Field Description private Structure1D.IndexMapper<java.lang.Object>[]
myMappers
private long[]
myStructure
-
Constructor Summary
Constructors Modifier Constructor Description protected
ReferenceMapper(StructureAnyD structure, Structure1D.IndexMapper<java.lang.Object>[] mappers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> long
toIndex(int dim, T key)
long
toIndex(java.lang.Object[] keys)
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)
java.lang.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 java.lang.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 Detail
-
myMappers
private final Structure1D.IndexMapper<java.lang.Object>[] myMappers
-
myStructure
private final long[] myStructure
-
-
Constructor Detail
-
ReferenceMapper
protected ReferenceMapper(StructureAnyD structure, Structure1D.IndexMapper<java.lang.Object>[] mappers)
-
-
Method Detail
-
toIndex
public <T> long toIndex(int dim, T key)
-
toIndex
public long toIndex(java.lang.Object[] keys)
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<java.lang.Object[]>
-
toKey
public <T> T toKey(int dim, long index)
-
toKey
public java.lang.Object[] toKey(long index)
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<java.lang.Object[]>
-
toKey
public <T extends java.lang.Comparable<? super T>> T toKey(long index, int dim)
-
-