import java.util.ArrayList;
public class Main {
public static void main(String[] args) {
SomeMulti someMulti = new SomeMulti();
Draw formatter = new Draw();
ArrayList<Integer> numbers = new ArrayList<Integer>();
ArrayList<Integer> numbers2 = new ArrayList<Integer>();
numbers = someMulti.multiply();
numbers2 = someMulti.multiply2();
System.out.println(formatter.drawHz(numbers, numbers2));
}
}
import java.util.ArrayList;
public class SomeMulti {
public ArrayList<Integer> multiply() {
ArrayList<Integer> numbers = new ArrayList<Integer>();
for (int i = 0; i < 10; i++) {
numbers.add((2 + (i * 2)));
}
return numbers;
}
public ArrayList<Integer> multiply2() {
ArrayList<Integer> numbers2 = new ArrayList<Integer>();
for (int i = 0; i < 10; i++) {
numbers2.add(i + 1);
}
return numbers2;
}
}
import java.util.ArrayList;
public class Draw {
public StringBuilder drawHz(ArrayList<Integer> numbers, ArrayList<Integer> numbers2) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < numbers.size(); i++) {
sb.append("nubmer " + i + " is " + numbers.get(i)).append("\n");
sb.append("nubmer2 " + i + " is " + numbers2.get(i)).append("\n");
}
return sb;
}
}
public void orderByAreaOnline() {
if (cbSetAreaOnline.getSelectionModel().getSelectedItem().toString().equals("-")) {
clearAreaOnlineNoDateWithAreaCB();
loadTableViewAreaOnline(obListAreaOnline, connToKZ, tableAreaOnline);
} else {
refreshJournalOnLineSelectArea(obListAreaOnline, TABLE_JOURNAL, tableAreaOnline, connToKZ, pst, rs, cbSetAreaOnline);
}
}
private void loadTableViewAreaOnline(ObservableList oblist, Connection conn, TableView table) {
oblist.clear();
try {
String sql = "SELECT journal.idauto, "
+ "journal.dateAreaOut, "
+ "journal.areaTimeOut, "
+ "journal.number, "
+ "journal.mark, "
+ "journal.model, "
+ "journal.driver, "
+ "journal.mileageOut, "
+ "journal.mechMileageOut, "
+ "journal.fuelMainOut, "
+ "journal.fuelAddOut, "
+ "journal.fuelMechOut, "
+ "journal.areaOut, "
+ "journal.vehicleID, "
+ "vehicleList.fuelNorm "
+ "FROM journal join vehicleList on journal.vehicleID = vehicleList.vehicleId "
+ "where journal.status = '" + VEH_STATUS_ONLINE + "' "
+ "ORDER by journal.dateAreaOut, journal.areaTimeOut";
pst = conn.prepareStatement(sql);
pst.setQueryTimeout(40000);
rs = pst.executeQuery();
while (rs.next()) {
oblist.add(new ModelTableOnline(
rs.getString("idauto"),
rs.getString("dateAreaOut"),
rs.getString("areaTimeOut"),
rs.getString("number"),
rs.getString("mark"),
//
rs.getString("model"),
rs.getString("driver"),
rs.getString("mileageOut"),
rs.getString("mechMileageOut"),
rs.getString("fuelMainOut"),
rs.getString("fuelAddOut"),
rs.getString("fuelMechOut"),
rs.getString("areaOut"),
rs.getString("vehicleID"),
rs.getString("fuelNorm")
));
}
table.setItems(oblist);
} catch (SQLException ex) {
Logger.getLogger(TableController.class.getName()).log(Level.SEVERE, null, ex);
}
}
public String makeSothing(String text) {
StringBuilder result = new StringBuilder();
String[] words = text.split(" ");
if (words.length > 0) {
result.append(reverseWord(words[0]));
}
for (int i = 1; i < words.length; i++) {
result.append(" ").append(reverseWord(words[i]));
}
return result.toString();
}