Package org.apache.calcite.util.mapping
Interface Mappings.SourceMapping
- All Superinterfaces:
Iterable<IntPair>,Mappings.CoreMapping
- 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 sourcing columns.
Properties:
- It has a finite number of sources and targets
- Each target has exactly one source
- Each source has at most one target
TODO: figure out which interfaces this should extend
-
Method Summary
Modifier and TypeMethodDescriptionReturns the mapping type.intgetSource(int target) Returns the source that a target maps to.intintgetSourceOpt(int target) Returns the source that a target maps to, or -1 if it is not mapped.intintgetTargetOpt(int source) Returns the target that a source maps to, or -1 if it is not mapped.inverse()booleanMethods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface org.apache.calcite.util.mapping.Mappings.CoreMapping
size
-
Method Details
-
getSourceCount
int getSourceCount() -
getSource
int getSource(int target) Returns the source that a target maps to.- Parameters:
target- target- Returns:
- source
- Throws:
Mappings.NoElementException- if target is not mapped
-
getSourceOpt
int getSourceOpt(int target) Returns the source that a target maps to, or -1 if it is not mapped. -
getTargetCount
int getTargetCount() -
getTargetOpt
int getTargetOpt(int source) Returns the target that a source maps to, or -1 if it is not mapped. -
getMappingType
MappingType getMappingType()Description copied from interface:Mappings.CoreMappingReturns the mapping type.- Specified by:
getMappingTypein interfaceMappings.CoreMapping- Returns:
- Mapping type
-
isIdentity
boolean isIdentity() -
inverse
Mapping inverse()
-