public abstract static class Mappings.AbstractMapping extends Object implements Mapping
Mapping.| Constructor and Description |
|---|
Mappings.AbstractMapping() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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, sizeinverseinversepublic 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)
getSourceOpt in interface Mappings.SourceMappinggetSourceOpt in interface Mappings.TargetMappingpublic int getSource(int target)
getSource in interface Mappings.SourceMappingpublic 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 |
This method relies upon the optional method Mapping.iterator().
Copyright © 2012–2015 The Apache Software Foundation. All rights reserved.