nested loop and remove duplicate sequence [message #1795441] |
Sat, 22 September 2018 14:15  |
Eclipse User |
|
|
|
Hello ,
I have two problems i need a help on solving them :
First : nested loop
for (s1 in supp){
for (s2 in supp){
s1.print()+s2.name.println();
}
}
i want to take s1 and then iterate with every s2 so i want the inner loop to be executed all and when its done go back to take the next s1 again with every s2
Is there any trick to do that ??
Second:
I executed an EOL statement( var result=Vtarget.supplier.flatten().Type) and the result of that statement is a number of sequences as the blows:
Sequence {Class [name=Tcontainer ]}
Sequence {Class [name=TargetParameterType ]}
Sequence {Class [name=Tproperty ]}
Sequence {Class [name=Tproperty]}
My question is how can i remove the duplicate ones for example Sequence {Class [name=Tproperty ]}
i tried to get the result and save it in a set to avoid the duplication but it didn't work. Is there any trick to do that?
|
|
|
|
Powered by
FUDForum. Page generated in 0.11476 seconds