Package org.apache.calcite.util.mapping
Interface Mapping
- All Superinterfaces:
- Iterable<IntPair>,- Mappings.CoreMapping,- Mappings.FunctionMapping,- Mappings.SourceMapping,- Mappings.TargetMapping
- All Known Implementing Classes:
- AbstractSourceMapping,- AbstractTargetMapping,- Mappings.AbstractMapping,- Mappings.FiniteAbstractMapping,- Mappings.IdentityMapping,- Mappings.OverridingSourceMapping,- Mappings.OverridingTargetMapping,- Mappings.PartialMapping,- Permutation
public interface Mapping
extends Mappings.FunctionMapping, Mappings.SourceMapping, Mappings.TargetMapping, Iterable<IntPair>
A Mapping is a relationship between a source domain to target
 domain of integers.
 
This interface represents the most general possible mapping. Depending on
 the MappingType of a particular mapping, some of the operations may
 not be applicable. If you call the method, you will receive a runtime error.
 For instance:
 
- If a target has more than one source, then the method
     Mappings.SourceMapping.getSource(int)will throwMappings.TooManyElementsException.
- If a source has no targets, then the method Mappings.FunctionMapping.getTarget(int)will throwMappings.NoElementException.
- 
Method SummaryModifier and TypeMethodDescriptionvoidclear()Removes all elements in the mapping.Returns the mapping type.intReturns the number of sources.intReturns the number of targets.booleanReturns whether this mapping is the identity.iterator()Returns an iterator over the elements in this mapping.intsize()Returns the number of elements in the mapping.Methods inherited from interface java.lang.IterableforEach, spliteratorMethods inherited from interface org.apache.calcite.util.mapping.Mappings.SourceMappinggetSource, getSourceOpt, getTargetOpt, inverseMethods inherited from interface org.apache.calcite.util.mapping.Mappings.TargetMappinggetSourceOpt, getTarget, getTargetOpt, inverse, set
- 
Method Details- 
iteratorReturns an iterator over the elements in this mapping.This method is optional; implementations may throw UnsupportedOperationException.
- 
getSourceCountint getSourceCount()Returns the number of sources. Valid sources will be in the range 0 .. sourceCount.- Specified by:
- getSourceCountin interface- Mappings.FunctionMapping
- Specified by:
- getSourceCountin interface- Mappings.SourceMapping
- Specified by:
- getSourceCountin interface- Mappings.TargetMapping
 
- 
getTargetCountint getTargetCount()Returns the number of targets. Valid targets will be in the range 0 .. targetCount.- Specified by:
- getTargetCountin interface- Mappings.SourceMapping
- Specified by:
- getTargetCountin interface- Mappings.TargetMapping
 
- 
getMappingTypeMappingType getMappingType()Description copied from interface:Mappings.CoreMappingReturns the mapping type.- Specified by:
- getMappingTypein interface- Mappings.CoreMapping
- Specified by:
- getMappingTypein interface- Mappings.FunctionMapping
- Specified by:
- getMappingTypein interface- Mappings.SourceMapping
- Returns:
- Mapping type
 
- 
isIdentityboolean isIdentity()Returns whether this mapping is the identity.- Specified by:
- isIdentityin interface- Mappings.SourceMapping
 
- 
clearvoid clear()Removes all elements in the mapping.
- 
sizeint size()Returns the number of elements in the mapping.- Specified by:
- sizein interface- Mappings.CoreMapping
 
 
-