The question but in C#. Java에는 C#의 명령이 있습니까? Matches-SearchTerm-Files- 관계에 필요합니다.Java : 목록 목록을 반복합니다.
foreach(var i in BunchOfItems.SelectMany(k => k.Items)) {}
[왜를위한 루프?] 내가 루프 중첩 된 이러한 구조를했을하지만 곧 부풀어 될 . 그래서 저는 위와 같이 좀 더 숙련 된 것을 선호합니다.
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;
}
이 라이브러리에는 요구 사항에 따라 다음과 같은 selectMany() 구현이 있습니다. for (val i : BunchOfItems.selectMany (bunchItemSelector()) {}. https://github.com/nicholas22/jpropel-light를 참조하십시오. –