Pergunta

I tried to overload an existing external class's operator with Xtend but it doesn't work. I can't write in the class source, like BigIntegerExtension. How should I do it?

Answer

The answer is pretty simple. We can override any of the operators what we want with operator overload.

// IntVar = IntVar
def static operator_equals(IntVar a, IntVar b) {
    return IntConstraintFactory.arithm(a, "=", b)
}
Foi útil?

Solução

The answer is pretty simple. We can override any of the operators what we want with operator overload.

// IntVar = IntVar
def static operator_equals(IntVar a, IntVar b) {
    return IntConstraintFactory.arithm(a, "=", b)
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top