Package org.apache.calcite.util.mapping
Class Mappings.OverridingSourceMapping
java.lang.Object
org.apache.calcite.util.mapping.Mappings.AbstractMapping
org.apache.calcite.util.mapping.Mappings.OverridingSourceMapping
- All Implemented Interfaces:
Iterable<IntPair>
,Mapping
,Mappings.CoreMapping
,Mappings.FunctionMapping
,Mappings.SourceMapping
,Mappings.TargetMapping
- Enclosing class:
Mappings
public static class Mappings.OverridingSourceMapping
extends Mappings.AbstractMapping
implements Mappings.SourceMapping
Source mapping that returns the same result as a parent
Mappings.SourceMapping
except for specific overriding elements.-
Constructor Summary
ConstructorDescriptionOverridingSourceMapping
(Mappings.SourceMapping parent, int source, int target) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Removes all elements in the mapping.Returns the mapping type.int
getSource
(int target) Returns the source that a target maps to.inverse()
boolean
Returns whether this mapping is the identity.iterator()
Returns an iterator over the elements in this mapping.int
size()
Returns the number of elements in the mapping.Methods inherited from class org.apache.calcite.util.mapping.Mappings.AbstractMapping
getSourceCount, getSourceOpt, getTarget, getTargetCount, getTargetOpt, set, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface org.apache.calcite.util.mapping.Mappings.SourceMapping
getSourceOpt, getTargetOpt
-
Constructor Details
-
OverridingSourceMapping
-
-
Method Details
-
clear
public void clear()Description copied from interface:Mapping
Removes all elements in the mapping. -
size
public int size()Description copied from interface:Mappings.CoreMapping
Returns the number of elements in the mapping.- Specified by:
size
in interfaceMapping
- Specified by:
size
in interfaceMappings.CoreMapping
-
inverse
- Specified by:
inverse
in interfaceMappings.SourceMapping
- Specified by:
inverse
in interfaceMappings.TargetMapping
-
getMappingType
Description copied from interface:Mappings.CoreMapping
Returns the mapping type.- Specified by:
getMappingType
in interfaceMapping
- Specified by:
getMappingType
in interfaceMappings.CoreMapping
- Specified by:
getMappingType
in interfaceMappings.FunctionMapping
- Specified by:
getMappingType
in interfaceMappings.SourceMapping
- Returns:
- Mapping type
-
getSource
public int getSource(int target) Description copied from interface:Mappings.SourceMapping
Returns the source that a target maps to.- Specified by:
getSource
in interfaceMappings.SourceMapping
- Overrides:
getSource
in classMappings.AbstractMapping
- Parameters:
target
- target- Returns:
- source
-
isIdentity
public boolean isIdentity()Description copied from interface:Mapping
Returns whether this mapping is the identity.- Specified by:
isIdentity
in interfaceMapping
- Specified by:
isIdentity
in interfaceMappings.SourceMapping
- Overrides:
isIdentity
in classMappings.AbstractMapping
-
iterator
Description copied from interface:Mapping
Returns an iterator over the elements in this mapping.This method is optional; implementations may throw
UnsupportedOperationException
.
-