public class ColumnMap extends Object
Constructor and Description |
---|
ColumnMap(String label,
int... elements)
Construct a column map - the elements are the
mappings of a tuple originally in the order 0,1,2,...
|
ColumnMap(String label,
List<T> input,
List<T> output) |
ColumnMap(String input,
String output)
Construct a column mapping that maps the input (one col, one char) to the output
|
ColumnMap(String label,
T[] input,
T[] output) |
Modifier and Type | Method and Description |
---|---|
<T> T |
fetchSlot(int idx,
T[] tuple)
Apply to an unmapped tuple to get the i'th slot after mapping : SPO->POS : 0'th slot is P from SPO
|
<T> T |
fetchSlot(int idx,
Tuple<T> tuple)
Apply to an unmapped tuple to get the i'th slot after mapping : SPO->POS : 0'th slot is P from SPO
|
int |
fetchSlotIdx(int idx)
Get the index of the i'th slot as it appears from a mapping : for SPO->POS : 0'th slot is P so 1->0
|
String |
getLabel() |
int |
length()
Length of mapping
|
<T> Tuple<T> |
map(Tuple<T> src)
Apply to an unmapped tuple to get a tuple with the column mapping applied
|
String |
mapName(String word)
Reorder the letters of a string by the same rules as this column map (forward, map direction)
|
<T> T |
mapSlot(int idx,
T[] tuple)
Apply to a mapped tuple to get the i'th slot as it appears after mapping : SPO->POS : 0'th slot is S from POS
|
<T> T |
mapSlot(int idx,
Tuple<T> tuple)
Apply to a mapped tuple to get the i'th slot as it appears after mapping : SPO->POS : 0'th slot is S from POS
|
int |
mapSlotIdx(int idx)
Get the index of the i'th slot as it appears after mapping : SPO->POS : 0'th slot is S from POS so 2->0
|
String |
toString() |
<T> Tuple<T> |
unmap(Tuple<T> src)
Apply to a mapped tuple to get a tuple with the column mapping reverse-applied
|
String |
unmapName(String word)
Reorder the letters of a string by the same rules as this column map (backward, fetch direction)
|
public ColumnMap(String input, String output)
public ColumnMap(String label, T[] input, T[] output)
public ColumnMap(String label, int... elements)
public int length()
public <T> T fetchSlot(int idx, Tuple<T> tuple)
public <T> T fetchSlot(int idx, T[] tuple)
public <T> T mapSlot(int idx, Tuple<T> tuple)
public <T> T mapSlot(int idx, T[] tuple)
public int mapSlotIdx(int idx)
public int fetchSlotIdx(int idx)
public <T> Tuple<T> map(Tuple<T> src)
public <T> Tuple<T> unmap(Tuple<T> src)
public String getLabel()
public String mapName(String word)
Licenced under the Apache License, Version 2.0