Package org.ojalgo.structure
Class Structure2D.RowColumnMapper<R,C>
- java.lang.Object
-
- org.ojalgo.structure.Structure2D.RowColumnMapper<R,C>
-
- All Implemented Interfaces:
Structure1D.IndexMapper<Structure2D.RowColumnKey<R,C>>
- Enclosing interface:
- Structure2D
public static class Structure2D.RowColumnMapper<R,C> extends java.lang.Object implements Structure1D.IndexMapper<Structure2D.RowColumnKey<R,C>>
-
-
Field Summary
Fields Modifier and Type Field Description private Structure1D.IndexMapper<C>
myColumnMapper
private Structure1D.IndexMapper<R>
myRowMapper
private long
myStructure
-
Constructor Summary
Constructors Modifier Constructor Description protected
RowColumnMapper(Structure2D structure, Structure1D.IndexMapper<R> rowMapper, Structure1D.IndexMapper<C> columnMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
toColumnIndex(C columnKey)
C
toColumnKey(long index)
long
toIndex(Structure2D.RowColumnKey<R,C> key)
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.long
toIndex(R rowKey, C colKey)
Structure2D.RowColumnKey<R,C>
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)
).long
toRowIndex(R rowKey)
R
toRowKey(long index)
-
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
-
myColumnMapper
private final Structure1D.IndexMapper<C> myColumnMapper
-
myRowMapper
private final Structure1D.IndexMapper<R> myRowMapper
-
myStructure
private final long myStructure
-
-
Constructor Detail
-
RowColumnMapper
protected RowColumnMapper(Structure2D structure, Structure1D.IndexMapper<R> rowMapper, Structure1D.IndexMapper<C> columnMapper)
-
-
Method Detail
-
toColumnIndex
public long toColumnIndex(C columnKey)
-
toColumnKey
public C toColumnKey(long index)
-
toIndex
public long toIndex(Structure2D.RowColumnKey<R,C> key)
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<R>
-
toKey
public Structure2D.RowColumnKey<R,C> 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<R>
-
toRowIndex
public long toRowIndex(R rowKey)
-
toRowKey
public R toRowKey(long index)
-
-