Skip to main content



      Home
Home » Modeling » Epsilon » nested loop and remove duplicate sequence(how to execute nested loop and remove the duplicate sequence )
nested loop and remove duplicate sequence [message #1795441] Sat, 22 September 2018 14:15 Go to next message
Eclipse UserFriend
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?
Re: nested loop and remove duplicate sequence [message #1795442 is a reply to message #1795441] Sat, 22 September 2018 14:19 Go to previous message
Eclipse UserFriend
Hi Taghreed,

#1: This is the expected behaviour of the loop you embedded in your message.

#2: Vtarget.supplier.flatten().Type.flatten().asSet() should return a set with no duplicates.

Cheers,
Dimitris

Previous Topic:xsdxml example
Next Topic:Epsilon Book - correction
Goto Forum:
  


Current Time: Mon Jul 14 11:56:08 EDT 2025

Powered by FUDForum. Page generated in 0.11476 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top