private static class Mappings.InverseMapping extends Object implements Mapping
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.
| Constructor and Description |
|---|
InverseMapping(Mapping parent) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all elements in the mapping.
|
MappingType |
getMappingType()
Returns the mapping type.
|
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) |
int |
size()
Returns the number of elements in the mapping.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorprivate final Mapping parent
InverseMapping(Mapping parent)
public Iterator<IntPair> iterator()
MappingThis method is optional; implementations may throw
UnsupportedOperationException.
public void clear()
Mappingpublic int size()
Mappingsize in interface Mappingsize in interface Mappings.CoreMappingpublic int getSourceCount()
MappinggetSourceCount in interface MappinggetSourceCount in interface Mappings.FunctionMappinggetSourceCount in interface Mappings.SourceMappinggetSourceCount in interface Mappings.TargetMappingpublic int getTargetCount()
MappinggetTargetCount in interface MappinggetTargetCount in interface Mappings.SourceMappinggetTargetCount in interface Mappings.TargetMappingpublic MappingType getMappingType()
Mappings.CoreMappinggetMappingType in interface MappinggetMappingType in interface Mappings.CoreMappinggetMappingType in interface Mappings.FunctionMappinggetMappingType in interface Mappings.SourceMappingpublic boolean isIdentity()
MappingisIdentity in interface MappingisIdentity in interface Mappings.SourceMappingpublic int getTargetOpt(int source)
Mappings.FunctionMappinggetTargetOpt in interface Mappings.FunctionMappinggetTargetOpt in interface Mappings.SourceMappinggetTargetOpt in interface Mappings.TargetMappingpublic int getTarget(int source)
Mappings.FunctionMappinggetTarget in interface Mappings.FunctionMappinggetTarget in interface Mappings.TargetMappingsource - sourcepublic int getSource(int target)
getSource in interface Mappings.SourceMappingpublic int getSourceOpt(int target)
getSourceOpt in interface Mappings.SourceMappinggetSourceOpt in interface Mappings.TargetMappingpublic Mapping inverse()
inverse in interface Mappings.SourceMappinginverse in interface Mappings.TargetMappingpublic void set(int source,
int target)
set in interface Mappings.TargetMappingCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.