1

このように書くよりも良い解決策はありSystem.out.printlnますか?

String nl = System.getProperty("line.separator");

for (k=0; k<=ds.size()-counter-1; k=k+counter){
            System.out.println (metric+" "+ds.get(k)+" "+ds.get(k+2)+" sensor=A cell="+ cellName + nl +
            metric+" "+ds.get(k)+" "+ds.get(k+3)+" sensor=B cell="+ cellName + nl + 
            metric+" "+ds.get(k)+" "+ds.get(k+4)+" sensor=C cell="+ cellName + nl + 
            metric+" "+ds.get(k)+" "+ds.get(k+5)+" sensor=D cell="+ cellName + nl +
            metric+" "+ds.get(k)+" "+ds.get(k+6)+" sensor=E cell="+ cellName + nl + 
            metric+" "+ds.get(k)+" "+ds.get(k+7)+" sensor=F cell="+ cellName + nl + 
            metric+" "+ds.get(k)+" "+ds.get(k+8)+" sensor=G cell="+ cellName + nl + 
            metric+" "+ds.get(k)+" "+ds.get(k+9)+" sensor=H cell="+ cellName + nl +
            metric+" "+ds.get(k)+" "+ds.get(k+10)+" sensor=I cell="+ cellName + nl +    
            metric+" "+ds.get(k)+" "+ds.get(k+11)+" sensor=L cell="+ cellName + nl +    
            metric+" "+ds.get(k)+" "+ds.get(k+12)+" sensor=M cell="+ cellName + nl +
            metric+" "+ds.get(k)+" "+ds.get(k+13)+" sensor=N cell="+ cellName); 
            }   
4

1 に答える 1