public static class Mappings.IdentityMapping extends Mappings.AbstractMapping implements Mappings.FunctionMapping, Mappings.TargetMapping, Mappings.SourceMapping
| Constructor and Description |
|---|
IdentityMapping(int size)
Creates an identity mapping.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all elements in the mapping.
|
MappingType |
getMappingType()
Returns the mapping type.
|
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.
|
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.
|
toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic IdentityMapping(int size)
size - Size, or -1 if infinite.public void clear()
Mappingpublic int size()
Mappings.CoreMappingsize in interface Mappingsize in interface Mappings.CoreMappingpublic Mapping inverse()
inverse in interface Mappings.SourceMappinginverse in interface Mappings.TargetMappingpublic boolean isIdentity()
MappingisIdentity in interface MappingisIdentity in interface Mappings.SourceMappingisIdentity in class Mappings.AbstractMappingpublic void set(int source,
int target)
set in interface Mappings.TargetMappingset in class Mappings.AbstractMappingpublic MappingType getMappingType()
Mappings.CoreMappinggetMappingType in interface MappinggetMappingType in interface Mappings.CoreMappinggetMappingType in interface Mappings.FunctionMappinggetMappingType in interface Mappings.SourceMappingpublic int getSourceCount()
MappinggetSourceCount in interface MappinggetSourceCount in interface Mappings.FunctionMappinggetSourceCount in interface Mappings.SourceMappinggetSourceCount in interface Mappings.TargetMappinggetSourceCount in class Mappings.AbstractMappingpublic int getTargetCount()
MappinggetTargetCount in interface MappinggetTargetCount in interface Mappings.SourceMappinggetTargetCount in interface Mappings.TargetMappinggetTargetCount in class Mappings.AbstractMappingpublic int getTarget(int source)
getTarget in interface Mappings.FunctionMappinggetTarget in interface Mappings.TargetMappinggetTarget in class Mappings.AbstractMappingsource - sourcepublic int getTargetOpt(int source)
getTargetOpt in interface Mappings.FunctionMappinggetTargetOpt in interface Mappings.SourceMappinggetTargetOpt in interface Mappings.TargetMappinggetTargetOpt in class Mappings.AbstractMappingsource - sourcepublic int getSource(int target)
getSource in interface Mappings.SourceMappinggetSource in class Mappings.AbstractMappingtarget - targetpublic int getSourceOpt(int target)
getSourceOpt in interface Mappings.SourceMappinggetSourceOpt in interface Mappings.TargetMappinggetSourceOpt in class Mappings.AbstractMappingtarget - targetpublic Iterator<IntPair> iterator()
MappingThis method is optional; implementations may throw
UnsupportedOperationException.
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.