Wildcards in FUNN$$ einfuegen #55
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Wenn ein Typ FUN1$$<Integer,Integer> inferiert könnte die Typinformation im Class-File FUN1$$<? super Integer,? extends Integer> sein.
Beispiel
mathStruc.class
javap mathStruc.class
Compiled from "mathStruc.jav"
public class mathStruc<K$ extends EYS$, EYL$ extends AB$, AB$ extends K$, EYS$> {
K$ model;
Fun1$$<Fun2$
<EYS
, EYS$, EYL$>, Fun1$$<mathStruc, mathStruc>> innerOp;public mathStruc(AB$);
}
und
javap MatrixOP.class
Compiled from "MatrixOP.jav"
public class MatrixOP extends java.util.Vector<java.util.Vector<java.lang.Integer>> {
public Fun2$$<java.util.Vector<? extends java.util.Vector<? extends java.lang.Integer>>, java.util.Vector<? extends java.util.Vector<? extends java.lang.Integer>>, MatrixOP> mul;
public MatrixOP();
public MatrixOP(java.util.Vector<java.util.Vector<java.lang.Integer>>);
}
Um mul aus MatrixOP anwenden zu können muss man als 4. Argument
Vector<? extends Vector<? extends Integer>>> statt MatrixOP einsetzen:
mathStruc<MatrixOP, MatrixOP, MatrixOP,
!!Vector<? extends Vector<? extends Integer>>!!> mms
= new mathStruc<>(m1);
mathStruc<MatrixOP, MatrixOP, MatrixOP,
!!Vector<? extends Vector<? extends Integer>>!!> mms2
= new mathStruc<>(m2);
mathStruc<MatrixOP, MatrixOP, MatrixOP, MatrixOP> mms3
= mms.innerOp.apply(m1.mul).apply(mms2);
System.out.println(mms3.model);
Ziel wäre:
mathStruc<MatrixOP, MatrixOP, MatrixOP, !!MatrixOP!!> mms
= new mathStruc<>(m1);
mathStruc<MatrixOP, MatrixOP, MatrixOP, !!MatrixOP!!> mms2
= new mathStruc<>(m2);