|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.util.mapping.Mappings.InverseMapping
private static class Mappings.InverseMapping
Decorator which converts any Mapping
into the inverse of itself.
If the mapping does not have an inverse -- for example, if a given source can have more than one target -- then the corresponding method call of the underlying mapping will raise a runtime exception.
Field Summary | |
---|---|
private Mapping |
parent
|
Constructor Summary | |
---|---|
Mappings.InverseMapping(Mapping parent)
|
Method Summary | |
---|---|
MappingType |
getMappingType()
|
int |
getSource(int target)
|
int |
getSourceCount()
Returns the number of sources. |
int |
getSourceOpt(int target)
|
int |
getTarget(int source)
Returns the target that a source maps to. |
int |
getTargetCount()
Returns the number of targets. |
int |
getTargetOpt(int source)
Returns the target that a source maps to, or -1 if it is not mapped. |
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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final Mapping parent
Constructor Detail |
---|
Mappings.InverseMapping(Mapping parent)
Method Detail |
---|
public Iterator<IntPair> iterator()
Mapping
This method is optional; implementations may throw UnsupportedOperationException
.
iterator
in interface Iterable<IntPair>
iterator
in interface Mapping
public int getSourceCount()
Mapping
getSourceCount
in interface Mapping
getSourceCount
in interface Mappings.FunctionMapping
getSourceCount
in interface Mappings.SourceMapping
getSourceCount
in interface Mappings.TargetMapping
public int getTargetCount()
Mapping
getTargetCount
in interface Mapping
getTargetCount
in interface Mappings.SourceMapping
getTargetCount
in interface Mappings.TargetMapping
public MappingType getMappingType()
getMappingType
in interface Mapping
getMappingType
in interface Mappings.FunctionMapping
getMappingType
in interface Mappings.SourceMapping
getMappingType
in interface Mappings.TargetMapping
public boolean isIdentity()
Mapping
isIdentity
in interface Mapping
isIdentity
in interface Mappings.SourceMapping
public int getTargetOpt(int source)
Mappings.FunctionMapping
getTargetOpt
in interface Mappings.FunctionMapping
getTargetOpt
in interface Mappings.SourceMapping
getTargetOpt
in interface Mappings.TargetMapping
public int getTarget(int source)
Mappings.FunctionMapping
getTarget
in interface Mappings.FunctionMapping
getTarget
in interface Mappings.TargetMapping
source
- source
public int getSource(int target)
getSource
in interface Mappings.SourceMapping
public int getSourceOpt(int target)
getSourceOpt
in interface Mappings.SourceMapping
getSourceOpt
in interface Mappings.TargetMapping
public Mapping inverse()
inverse
in interface Mappings.SourceMapping
inverse
in interface Mappings.TargetMapping
public void set(int source, int target)
set
in interface Mappings.TargetMapping
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |