Note that there are some explanatory texts on larger screens.

plurals
  1. POsorting on ArrayList but ArrayList have same value
    text
    copied!<p>my text is</p> <pre><code>---- SınİSırU, SınİUzO puanları azalan : ------ {deneme deneme deneme}{ANYA}{LTD. ŞTİ.}{1.75}{1.25}{14.00}{10.00}{1.75}{1.2}{false} ------ {deneme deneme deneme }{DZLİ}{ ŞTİ.}{1.43}{1.14}{11.43}{9.14}{1.43}{0.57}{false} ------ {deneme deneme deneme }{MEİN}{ ŞTİ.}{1.29}{1.10}{10.29}{8.76}{1.29}{0.55}{false} ------ {deneme deneme deneme }{HAY}{ ŞTİ.}{1.29}{1.10}{10.29}{8.76}{1.29}{0.55}{false} ------ {deneme deneme deneme }{AHAN}{ ŞTİ.}{1.29}{1.10}{10.29}{8.76}{1.29}{0.55}{false} ------ {deneme deneme deneme }{MSA}{ ŞTİ.}{1.29}{1.10}{10.29}{8.76}{1.29}{0.55}{false} ------ {deneme deneme deneme }{Ş}{ ŞTİ.}{1.29}{1.10}{10.29}{8.76}{1.29}{0.55}{false} ------ {deneme deneme deneme }{KO}{. ŞTİ.}{1.25}{1.08}{10.00}{8.67}{1.25}{0.54}{false} </code></pre> <p>kolon1:1.75,1.43,1.29...</p> <p>kolon2:1.25,1.14,1.10..</p> <p>then ı sorted them smallest to bigger. </p> <p>there are replaced number ı dont want replaced number. for exemaple if my contain text contain 3,3,3,3,3,2,2,2,2,1,1,1,1,1,1</p> <p>ı want only 1 2 3</p> <pre><code> public class PointStatue { private static List&lt;Double&gt; col1 = new ArrayList&lt;Double&gt;(); private static List&lt;Double&gt; col2 = new ArrayList&lt;Double&gt;(); private static List&lt;Double&gt; col3 = new ArrayList&lt;Double&gt;(); private static List&lt;Double&gt; col4 = new ArrayList&lt;Double&gt;(); private static List&lt;Double&gt; col5 = new ArrayList&lt;Double&gt;(); private static List&lt;Double&gt; col6 = new ArrayList&lt;Double&gt;(); private static List&lt;Double&gt; list=new ArrayList&lt;Double&gt;(); private static List&lt;Double&gt; numbers = new ArrayList&lt;Double&gt;(); public static void main(String[] args) throws IOException { ArrayList&lt;String&gt; puan; puan = okuDiziyeKoy("C:\\deneme\\HW.txt"); System.out.format("%d kayıt okundu.%n", puan.size()); for (int j = 0; j &lt; puan.size(); j++) { String point = puan.get(j); String[] edit = point.split("[\\{\\}\\)]"); for (String s : edit) { String a = s.replaceAll("[\\}\\-\\&gt;\\&gt;\\]\\[\\#\\*\\{]+", ""); String b = a.replaceAll("[\\.]+", ","); Scanner scanner = new Scanner(b); while (scanner.hasNext()) { if (scanner.hasNextDouble()) { Double doubleValue = scanner.nextDouble(); numbers.add(doubleValue); // System.out.println(Arrays.deepToString(numbers.toArray())); }// if scan end else { //if it is string comes value here String stringValue = scanner.next(); }// if scan end }// while end }// for string s }// for j end int col=1; for(int i=0;i&lt;numbers.size();i++) { Double rowValue = numbers.get(i); switch(col) { case 1: col1.add(rowValue); Collections.sort(col1); col++; break; case 2: col2.add(rowValue); Collections.sort(col2); col++; break; case 3: col3.add(rowValue); Collections.sort(col3); col++; break; case 4: col4.add(rowValue); Collections.sort(col4); col++; break; case 5: col5.add(rowValue); Collections.sort(col5); col++; break; case 6: col6.add(rowValue); Collections.sort(col6); col = 1; break; }//switch end }//for i end System.out.println("kolon1"+col1); System.out.println("kolon2"+col2); System.out.println("kolon3"+col3); System.out.println("kolon4"+col4); System.out.println("kolon5"+col5); System.out.println("kolon6"+col6); }// main end private static ArrayList&lt;String&gt; okuDiziyeKoy(String dosyaAdı) { ArrayList&lt;String&gt; dizi = new ArrayList&lt;String&gt;(); try { FileInputStream fIS; fIS = new FileInputStream(dosyaAdı); Reader r = new InputStreamReader(fIS, "ISO-8859-9"); BufferedReader bR = new BufferedReader(r); String satır; while ((satır = bR.readLine()) != null) { dizi.add(satır); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return dizi; }// okuDiziyeKoyEnd }// class end </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload