The question but in C#. Entonces, ¿Java tiene el comando C#? Lo necesito para Matches-SearchTerm-Files-relationship.Java: iterando a través de la lista de listas?
foreach(var i in BunchOfItems.SelectMany(k => k.Items)) {}
[¿Por qué no para-bucles?] he hecho este tipo de estructuras en bucles for anidados pero pronto se convertirá hinchado. Así que prefiero algo más succint como el de arriba.
public static Stack<Integer[]> getPrintPoss(String s,File f,Integer maxViewPerF)
{
Stack<File> possPrint = new Stack<File>();
Integer[] poss = new Integer[4]();
int u,size;
for(File f:files)
{
size = f2S(f).length();
u = Math.min(maxViewsPerF,size);
for(int i=0; i<u;i++)
{
// Do something --- bloated, and soon out of control
// wants more succintly
}
}
return possPrint;
}
Esta biblioteca tiene una implementación selectMany() que se vería así para su requisito: para (val i: BunchOfItems.selectMany (bunchItemSelector()) {}. Consulte https://github.com/nicholas22/jpropel-light –