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