public class FieldIDMapper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected int[] |
componentFields
The field numbers from a component DataSource.
|
protected int[] |
compositeFields
The one-to-one corresponding field numbers from the composite
DataSource.
|
Constructor and Description |
---|
FieldIDMapper(FieldIDMapper fm,
RecordSpec cpsSpec)
Constructs a FieldIDMapper from a subset of given FieldIDMapper.
|
FieldIDMapper(int numFields)
Constructs an identity FieldIDMapper of specified size.
|
FieldIDMapper(int[] source)
Constructs a FieldIDMapper from a simple array of ints.
|
FieldIDMapper(int[] componentFIDs,
int[] compositeFIDs)
Constructs a FieldIDMapper with two parallel arrays.
|
FieldIDMapper(RecordSpec recSpec)
Constructs a FieldIDMapper from a RecordSpec which specifies the
attributes from a DataSource.
|
Modifier and Type | Method and Description |
---|---|
void |
checkComponentID()
Check whether the numbers in this.componentFields are distinct.
|
void |
checkCompositeID()
Check whether the numbers in this.compositeFields are distinct.
|
java.lang.Object |
clone()
Return a copy of this FieldIDMapper object
|
FieldIDMapper |
combine(FieldIDMapper fmap1,
FieldIDMapper fmap2)
Put two FieldIDMappers together.
|
static FieldIDMapper |
createComponentMap(FieldIDMapper src,
FieldIDMapper dst)
Constructs a FieldIDMapper by composing two related FieldIDMappers.
|
static FieldIDMapper |
createCrossMap(FieldIDMapper src,
FieldIDMapper dst)
Constructs a FieldIDMapper by composing two related FieldIDMappers.
|
boolean |
equals(java.lang.Object obj)
Return true if parameter equals this object, false otherwise.
|
int[] |
getComponentFields()
Returns the field numbers of the component DataSource.
|
int[] |
getCompositeFields()
Returns the field numbers of the composite DataSource.
|
int[] |
getDestinations()
Returns the field numbers of the composite DataSource.
|
int |
getMaxCpnID()
Returns the maximum field number of this.componentFields.
|
int |
getMaxCpsID()
Returns the maximum field number of this.compositeFields.
|
int[] |
getSources()
Returns the source identifier array
This is the same as getComponentFields(), but FieldIDMapper
need not be restricted to Component/Composite mapping
|
protected static void |
identity(int[] array)
Assign identity mapping to the argument array
"identity" mapping: 0,1, ...
|
protected static int[] |
identityArray(int len)
Create a integer array of specified length, initialized
to the "identity" mapping: 0,1, ...
|
boolean |
isIdentityMapper()
Returns true if it is an identity FieldIDMapper.
|
static void |
main(java.lang.String[] args) |
int |
size()
Returns the number of fields.
|
int |
toComponent(int compositeIndex)
return the component index given a composite index.
|
RecordSpec |
toComponent(RecordSpec spec1)
Returns a RecordSpec mapped to the given RecordSpec whose
field numbers could be found in this.compositeFields.
|
int |
toComposite(int componentIndex)
Returns the composite index given the component index.
|
int |
toDestination(int sourceIndex)
Returns the destination index given the source index.
|
int |
toSource(int destinationIndex)
return the source index given a destination index.
|
java.lang.String |
toString()
to String
|
protected int[] componentFields
protected int[] compositeFields
public FieldIDMapper(int[] componentFIDs, int[] compositeFIDs)
public FieldIDMapper(int numFields)
public FieldIDMapper(RecordSpec recSpec)
public FieldIDMapper(int[] source)
public FieldIDMapper(FieldIDMapper fm, RecordSpec cpsSpec)
public static FieldIDMapper createCrossMap(FieldIDMapper src, FieldIDMapper dst)
public static FieldIDMapper createComponentMap(FieldIDMapper src, FieldIDMapper dst)
protected static final int[] identityArray(int len)
protected static final void identity(int[] array)
public java.lang.Object clone()
clone
in class java.lang.Object
public FieldIDMapper combine(FieldIDMapper fmap1, FieldIDMapper fmap2)
public boolean isIdentityMapper()
public int[] getComponentFields()
public int[] getCompositeFields()
public int[] getSources()
public int[] getDestinations()
public int getMaxCpnID()
public int getMaxCpsID()
public int size()
public int toComponent(int compositeIndex)
public int toComposite(int componentIndex)
public final int toSource(int destinationIndex)
public final int toDestination(int sourceIndex)
public RecordSpec toComponent(RecordSpec spec1)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public void checkComponentID()
public void checkCompositeID()
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)