|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eigenbase.util.mapping.Mappings.AbstractMapping
org.eigenbase.util.mapping.Mappings.PartialFunctionImpl
private static class Mappings.PartialFunctionImpl
Implementation of Mapping where a source can have at most one
target, and a target can have any number of sources. The source count
must be finite, but the target count may be infinite.
The implementation uses an array for the forward-mapping, but does not store the backward mapping.
| Field Summary | |
|---|---|
private MappingType |
mappingType
|
private int |
sourceCount
|
private int |
targetCount
|
private int[] |
targets
|
| Constructor Summary | |
|---|---|
Mappings.PartialFunctionImpl(int sourceCount,
int targetCount,
MappingType mappingType)
|
|
| Method Summary | |
|---|---|
MappingType |
getMappingType()
|
int |
getSourceCount()
Returns the number of sources. |
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()
|
Iterator<IntPair> |
iterator()
Returns an iterator over the elements in this mapping. |
void |
set(int source,
int target)
|
void |
setAll(Mapping mapping)
|
| Methods inherited from class org.eigenbase.util.mapping.Mappings.AbstractMapping |
|---|
getSource, getSourceOpt, getTarget, isIdentity |
| 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 |
|---|
getSourceOpt, getTarget |
| Field Detail |
|---|
private final int sourceCount
private final int targetCount
private final MappingType mappingType
private final int[] targets
| Constructor Detail |
|---|
public Mappings.PartialFunctionImpl(int sourceCount,
int targetCount,
MappingType mappingType)
| Method Detail |
|---|
public int getSourceCount()
Mapping
getSourceCount in interface MappinggetSourceCount in interface Mappings.FunctionMappinggetSourceCount in interface Mappings.SourceMappinggetSourceCount in interface Mappings.TargetMappinggetSourceCount in class Mappings.AbstractMappingpublic int getTargetCount()
Mapping
getTargetCount in interface MappinggetTargetCount in interface Mappings.SourceMappinggetTargetCount in interface Mappings.TargetMappinggetTargetCount in class Mappings.AbstractMappingpublic Iterator<IntPair> iterator()
MappingThis method is optional; implementations may throw UnsupportedOperationException.
iterator in interface Iterable<IntPair>iterator in interface Mappingpublic MappingType getMappingType()
getMappingType in interface MappinggetMappingType in interface Mappings.FunctionMappinggetMappingType in interface Mappings.SourceMappinggetMappingType in interface Mappings.TargetMappingpublic Mapping inverse()
inverse in interface Mappings.SourceMappinginverse in interface Mappings.TargetMapping
public void set(int source,
int target)
set in interface Mappings.TargetMappingset in class Mappings.AbstractMappingpublic void setAll(Mapping mapping)
public int getTargetOpt(int source)
Mappings.FunctionMapping
getTargetOpt in interface Mappings.FunctionMappinggetTargetOpt in interface Mappings.SourceMappinggetTargetOpt in interface Mappings.TargetMappinggetTargetOpt in class Mappings.AbstractMapping
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||