Frage

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)
}
War es hilfreich?

Lösung

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)
}
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top