public interface Mapping extends Mappings.FunctionMapping, Mappings.SourceMapping, Mappings.TargetMapping, Iterable<IntPair>
This interface represents the most general possible mapping. Depending on
the MappingType of a particular mapping, some of the operations may
not be applicable. If you call the method, you will receive a runtime error.
For instance:
Mappings.SourceMapping.getSource(int) will throw
Mappings.TooManyElementsException.
Mappings.FunctionMapping.getTarget(int) will throw
Mappings.NoElementException.
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all elements in the mapping.
|
MappingType |
getMappingType()
Returns the mapping type.
|
int |
getSourceCount()
Returns the number of sources.
|
int |
getTargetCount()
Returns the number of targets.
|
boolean |
isIdentity()
Returns whether this mapping is the identity.
|
Iterator<IntPair> |
iterator()
Returns an iterator over the elements in this mapping.
|
int |
size()
Returns the number of elements in the mapping.
|
getSource, getSourceOpt, getTargetOpt, inversegetSourceOpt, getTarget, getTargetOpt, inverse, setIterator<IntPair> iterator()
This method is optional; implementations may throw
UnsupportedOperationException.
int getSourceCount()
getSourceCount in interface Mappings.FunctionMappinggetSourceCount in interface Mappings.SourceMappinggetSourceCount in interface Mappings.TargetMappingint getTargetCount()
getTargetCount in interface Mappings.SourceMappinggetTargetCount in interface Mappings.TargetMappingMappingType getMappingType()
Mappings.CoreMappinggetMappingType in interface Mappings.CoreMappinggetMappingType in interface Mappings.FunctionMappinggetMappingType in interface Mappings.SourceMappingboolean isIdentity()
isIdentity in interface Mappings.SourceMappingvoid clear()
int size()
size in interface Mappings.CoreMappingCopyright © 2012–2015 The Apache Software Foundation. All rights reserved.