public abstract class AbstractTargetMapping extends Mappings.AbstractMapping implements Mapping
Mappings.TargetMapping where the
number of sources and targets are specified as constructor parameters and you
just need to implement one method,| Constructor and Description |
|---|
AbstractTargetMapping(int sourceCount,
int targetCount) |
| 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.
|
abstract int |
getTargetOpt(int source)
Returns the target that a source maps to, or -1 if it is not mapped.
|
Mapping |
inverse() |
Iterator<IntPair> |
iterator()
Returns an iterator over the elements in this mapping.
|
int |
size()
Returns the number of elements in the mapping.
|
getSource, getSourceOpt, getTarget, isIdentity, set, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisIdentitygetSource, getSourceOptgetSourceOpt, getTarget, setpublic AbstractTargetMapping(int sourceCount,
int targetCount)
public 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 Mapping inverse()
inverse in interface Mappings.SourceMappinginverse in interface Mappings.TargetMappingpublic int size()
Mappingsize in interface Mappingsize in interface Mappings.CoreMappingpublic void clear()
Mappingpublic MappingType getMappingType()
Mappings.CoreMappinggetMappingType in interface MappinggetMappingType in interface Mappings.CoreMappinggetMappingType in interface Mappings.FunctionMappinggetMappingType in interface Mappings.SourceMappingpublic Iterator<IntPair> iterator()
MappingThis method is optional; implementations may throw
UnsupportedOperationException.
public abstract int getTargetOpt(int source)
Mappings.FunctionMappinggetTargetOpt in interface Mappings.FunctionMappinggetTargetOpt in interface Mappings.SourceMappinggetTargetOpt in interface Mappings.TargetMappinggetTargetOpt in class Mappings.AbstractMappingCopyright © 2012–2015 The Apache Software Foundation. All rights reserved.