LV2: modul zesilovače, dle oficiálního příkladu, ale bez závislosti na Pythonu – stačí gcc a make
1 package cz.frantovo.langtable;
3 import cz.frantovo.langtable.Keyboards.*;
5 import javax.xml.bind.JAXBContext;
6 import javax.xml.bind.JAXBException;
7 import javax.xml.bind.Unmarshaller;
11 * @author Ing. František Kučera (frantovo.cz)
13 public class LangTable {
16 * @param args the command line arguments
18 public static void main(String[] args) throws JAXBException {
21 JAXBContext c = JAXBContext.newInstance(Keyboards.class);
22 Unmarshaller u = c.createUnmarshaller();
24 long start = System.currentTimeMillis();
25 Object o = u.unmarshal(new File("data/keyboards.xml"));
26 System.out.println("Time: " + (System.currentTimeMillis() - start) + " ms");
28 Keyboards keyboards = (Keyboards) o;
30 for (Keyboard k : keyboards.getKeyboards()) {
31 System.out.println(k.getId());
32 System.out.println(" " + k.getDescription());
33 System.out.println(" " + k.getComment());
34 System.out.println(" " + k.isAscii());
36 System.out.println(" languages: " + k.getLanguages().size());
37 for (Language l : k.getLanguages()) {
38 System.out.println(" " + l);
41 System.out.println(" territories: " + k.getTerritories().size());
42 for (Territory t : k.getTerritories()) {
43 System.out.println(" " + t);