[java-dev] beginner question about Atom.intersection
Emmanuel Jourdan
c74-mailinglists at e--j.com
Sat Sep 1 10:47:00 MDT 2007
- Previous message: [java-dev] beginner question about Atom.intersection
- Next message: [java-dev] Re: beginner question about Atom.intersection
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 1 sept. 07, at 18:07, matpe wrote:
> public void listIntersect(Atom[] a) {
> result = a;
> for (int i=1;i<2;i++){
> result = Atom.intersection(inputList1, inputList2);
> }
> post("vedi " +inputList1);
> outlet(0, result);
> }
I didn't try but the following should work:
public class Intersect2List extends MaxObject
{
private Atom[] inputList1;
private Atom[] inputList2;
private Atom[] result;
private Intersect2List() {
declareTypedIO("LL","L");
declareInlets(new int[]{DataTypes.LIST, DataTypes.LIST});
createInfoOutlet(false);
setInletAssist(new String[] {"list a and bang", "list b"});
setOutletAssist(new String[] {"intersection list"});
}
public void list(Atom[] args) {
switch (getInlet()) {
case 0:
inputList1 = args;
bang(); // trigger because it arrived in the left inlet
break;
case 1:
inputList2 = args;
break;
}
}
public void listIntersect(Atom[] a) {
result = Atom.intersection(inputList1, inputList2);
outlet(0, result);
}
public void bang() {
listIntersect();
}
}
Cheers,
ej
- Previous message: [java-dev] beginner question about Atom.intersection
- Next message: [java-dev] Re: beginner question about Atom.intersection
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
