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:
java.lang.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 parentMappings.SourceMapping
except for specific overriding elements.
-
-
Field Summary
Fields Modifier and Type Field Description private Mappings.SourceMapping
parent
private int
source
private int
target
-
Constructor Summary
Constructors Constructor Description OverridingSourceMapping(Mappings.SourceMapping parent, int source, int target)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Removes all elements in the mapping.MappingType
getMappingType()
Returns the mapping type.int
getSource(int target)
Mapping
inverse()
boolean
isIdentity()
Returns whether this mapping is the identity.java.util.Iterator<IntPair>
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 org.apache.calcite.util.mapping.Mappings.SourceMapping
getSourceOpt, getTargetOpt
-
-
-
-
Field Detail
-
parent
private final Mappings.SourceMapping parent
-
source
private final int source
-
target
private final int target
-
-
Constructor Detail
-
OverridingSourceMapping
public OverridingSourceMapping(Mappings.SourceMapping parent, int source, int target)
-
-
Method Detail
-
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
public Mapping inverse()
- Specified by:
inverse
in interfaceMappings.SourceMapping
- Specified by:
inverse
in interfaceMappings.TargetMapping
-
getMappingType
public MappingType 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)
- Specified by:
getSource
in interfaceMappings.SourceMapping
- Overrides:
getSource
in classMappings.AbstractMapping
-
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
-
-