package cell;
abstract class CellLinkDown extends CellFile
{
abstract CellBase boot(String fileName);
String fileName;
CellLinkDown(String fileName)
{
super(fileName);
this.fileName = fileName.toUpperCase();
}
void transmit(short row, String dest, float diff, byte shifted, float frac)
{
CellBase d = boot(dest);
float old = d.af(shifted, row);
float answer = old + (diff * frac);
d.so( shifted, row, new Float(answer));
}
static String match(String reg, String fix, String src)
// returns the dest file name, or null
{
String mat = "";
for (int i = 0; i < reg.length(); i++)
if (reg.charAt(i) == '*') mat += fix.charAt(i);
else if (reg.charAt(i) == '+') mat += src.charAt(i);
else mat += reg.charAt(i);
reg = mat;
mat = "";
for (int i = 0; i < fix.length(); i++)
if (fix.charAt(i) == '+') mat += reg.charAt(i);
else mat += fix.charAt(i);
fix = mat;
if (!reg.equalsIgnoreCase(fix)) return null;
return reg;
}
}