Package org.apache.calcite.util.mapping
Interface Mappings.TargetMapping
- All Superinterfaces:
Iterable<IntPair>
,Mappings.CoreMapping
,Mappings.FunctionMapping
- All Known Subinterfaces:
Mapping
- All Known Implementing Classes:
AbstractSourceMapping
,AbstractTargetMapping
,Mappings.AbstractMapping
,Mappings.FiniteAbstractMapping
,Mappings.IdentityMapping
,Mappings.OverridingSourceMapping
,Mappings.OverridingTargetMapping
,Mappings.PartialMapping
,Permutation
- Enclosing class:
Mappings
Mapping suitable for mapping columns to a target.
Properties:
- It has a finite number of sources and targets
- Each target has at most one source
- Each source has exactly one target
TODO: figure out which interfaces this should extend
-
Method Summary
Modifier and TypeMethodDescriptionint
int
getSourceOpt
(int target) Returns the source that a target maps to, or -1 if it is not mapped.int
getTarget
(int source) Returns the target that a source maps to.int
int
getTargetOpt
(int source) Returns the target that a source maps to, or -1 if it is not mapped.inverse()
void
set
(int source, int target) Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface org.apache.calcite.util.mapping.Mappings.CoreMapping
size
Methods inherited from interface org.apache.calcite.util.mapping.Mappings.FunctionMapping
getMappingType
-
Method Details
-
getSourceCount
int getSourceCount()- Specified by:
getSourceCount
in interfaceMappings.FunctionMapping
-
getSourceOpt
int getSourceOpt(int target) Returns the source that a target maps to, or -1 if it is not mapped. -
getTargetCount
int getTargetCount() -
getTarget
int getTarget(int source) Returns the target that a source maps to.- Specified by:
getTarget
in interfaceMappings.FunctionMapping
- Parameters:
source
- source- Returns:
- target
- Throws:
Mappings.NoElementException
- if source is not mapped
-
getTargetOpt
int getTargetOpt(int source) Returns the target that a source maps to, or -1 if it is not mapped.- Specified by:
getTargetOpt
in interfaceMappings.FunctionMapping
-
set
void set(int source, int target) -
inverse
Mapping inverse()
-