refactoring WaitForScore
This commit is contained in:
parent
eac6e43420
commit
e2070cf597
17 changed files with 757 additions and 410 deletions
21
Commons/src/utilities/Parse.java
Normal file
21
Commons/src/utilities/Parse.java
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package utilities;
|
||||
|
||||
import javafx.util.Pair;
|
||||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
* Author: Lorenzo Iovino on 12/07/2017.
|
||||
* Description: This is a module of parse utilities for different purposes
|
||||
*/
|
||||
public class Parse {
|
||||
|
||||
//Parse score and split by ":" character
|
||||
public static DefaultListModel<Pair<String, Integer>> score(DefaultListModel<String> score) {
|
||||
DefaultListModel<Pair<String, Integer>> list = new DefaultListModel<>();
|
||||
for (int i = 0; i < score.size() - 1; i++) {
|
||||
String[] splitted = score.get(i).split(":");
|
||||
list.addElement(new Pair<>(splitted[0], new Integer(splitted[1])));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue