I'm trying to implement a scala function object (specifically - to use with apache spark)
the equivalent java type is scala.Function0 (for a parameter less function)
besides the method that implements the business logic apply(), I see that I have to implement several other methods.
Simple googling the method names didn't help (I saw reference regarding a tag method which should be implemented - but the method name here are different.
Here is the code with those methods (with empty implementation).
private static class functionObject implements Function0<Integer>{
@Override
public Integer apply() {
// TODO Auto-generated method stub
return null;
}
@Override
public byte apply$mcB$sp() {
// TODO Auto-generated method stub
return 0;
}
@Override
public char apply$mcC$sp() {
// TODO Auto-generated method stub
return 0;
}
@Override
public double apply$mcD$sp() {
// TODO Auto-generated method stub
return 0;
}
@Override
public float apply$mcF$sp() {
// TODO Auto-generated method stub
return 0;
}
@Override
public int apply$mcI$sp() {
// TODO Auto-generated method stub
return 0;
}
@Override
public long apply$mcJ$sp() {
// TODO Auto-generated method stub
return 0;
}
@Override
public short apply$mcS$sp() {
// TODO Auto-generated method stub
return 0;
}
@Override
public void apply$mcV$sp() {
// TODO Auto-generated method stub
}
@Override
public boolean apply$mcZ$sp() {
// TODO Auto-generated method stub
return false;
}
}
What are these methods? how are they supposed to be implemented? is there a cleaner solution that adding these to any class?
AbstractFunctionX