public abstract static class Mappings.AbstractMapping extends Object implements Mapping
Mapping.| Constructor and Description |
|---|
AbstractMapping() |
| Modifier and Type | Method and Description |
|---|---|
int |
getSource(int target)
Returns the source that a target maps to.
|
int |
getSourceCount()
Returns the number of sources.
|
int |
getSourceOpt(int target)
Returns the source that a target maps to, or -1 if it is not mapped.
|
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.
|
boolean |
isIdentity()
Returns whether this mapping is the identity.
|
void |
set(int source,
int target) |
String |
toString()
Returns a string representation of this mapping.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclear, getMappingType, iterator, sizeinverseinverseforEach, spliteratorpublic void set(int source,
int target)
set in interface Mappings.TargetMappingpublic 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 getSourceOpt(int target)
Mappings.SourceMappinggetSourceOpt in interface Mappings.SourceMappinggetSourceOpt in interface Mappings.TargetMappingpublic int getSource(int target)
Mappings.SourceMappinggetSource in interface Mappings.SourceMappingtarget - targetpublic 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 boolean isIdentity()
MappingisIdentity in interface MappingisIdentity in interface Mappings.SourceMappingpublic String toString()
For example, the mapping
| source | 0 | 1 | 2 |
|---|---|---|---|
| target | -1 | 3 | 2 |
| target | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| source | -1 | -1 | 2 | 1 |
is represented by the string "[1:3, 2:2]".
This method relies upon the optional method Mapping.iterator().
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.