org.eigenbase.util.mapping
Class Mappings.OverridingTargetMapping

java.lang.Object
  extended by org.eigenbase.util.mapping.Mappings.AbstractMapping
      extended by org.eigenbase.util.mapping.Mappings.OverridingTargetMapping
All Implemented Interfaces:
Iterable<IntPair>, Mapping, Mappings.FunctionMapping, Mappings.SourceMapping, Mappings.TargetMapping
Enclosing class:
Mappings

public static class Mappings.OverridingTargetMapping
extends Mappings.AbstractMapping
implements Mappings.TargetMapping


Field Summary
private  Mappings.TargetMapping parent
           
private  int source
           
private  int target
           
 
Constructor Summary
Mappings.OverridingTargetMapping(Mappings.TargetMapping parent, int target, int source)
           
 
Method Summary
 MappingType getMappingType()
           
 int getTarget(int source)
          Returns the target that a source maps to.
 Mapping inverse()
           
 boolean isIdentity()
          Returns whether this mapping is the identity.
 Iterator<IntPair> iterator()
          Returns an iterator over the elements in this mapping.
 void set(int source, int target)
           
 
Methods inherited from class org.eigenbase.util.mapping.Mappings.AbstractMapping
getSource, getSourceCount, getSourceOpt, getTargetCount, getTargetOpt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eigenbase.util.mapping.Mappings.TargetMapping
getSourceCount, getSourceOpt, getTargetCount, getTargetOpt
 

Field Detail

parent

private final Mappings.TargetMapping parent

target

private final int target

source

private final int source
Constructor Detail

Mappings.OverridingTargetMapping

public Mappings.OverridingTargetMapping(Mappings.TargetMapping parent,
                                        int target,
                                        int source)
Method Detail

set

public void set(int source,
                int target)
Specified by:
set in interface Mappings.TargetMapping
Overrides:
set in class Mappings.AbstractMapping

inverse

public Mapping inverse()
Specified by:
inverse in interface Mappings.SourceMapping
Specified by:
inverse in interface Mappings.TargetMapping

getMappingType

public MappingType getMappingType()
Specified by:
getMappingType in interface Mapping
Specified by:
getMappingType in interface Mappings.FunctionMapping
Specified by:
getMappingType in interface Mappings.SourceMapping
Specified by:
getMappingType in interface Mappings.TargetMapping

isIdentity

public boolean isIdentity()
Description copied from interface: Mapping
Returns whether this mapping is the identity.

Specified by:
isIdentity in interface Mapping
Specified by:
isIdentity in interface Mappings.SourceMapping
Overrides:
isIdentity in class Mappings.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 interface Mappings.FunctionMapping
Specified by:
getTarget in interface Mappings.TargetMapping
Overrides:
getTarget in class Mappings.AbstractMapping
Parameters:
source - source
Returns:
target

iterator

public Iterator<IntPair> iterator()
Description copied from interface: Mapping
Returns an iterator over the elements in this mapping.

This method is optional; implementations may throw UnsupportedOperationException.

Specified by:
iterator in interface Iterable<IntPair>
Specified by:
iterator in interface Mapping