Subversion Repositories HomeAutomation

Rev

Details | Last modification | View Log | SVN | RSS feed

Rev Author Line No. Line
915 migan 1
import items.*;
2
 
3
import java.util.ArrayList;
4
import java.util.Iterator;
5
 
6
 
7
public class ListOutput {
8
    public void listAll(Database db)
9
    {
10
        this.listCommandTypes(db);
11
        this.listSendingTypes(db);
12
        this.listDirectionTypes(db);
13
        this.listCommands(db);
14
        this.listClasses(db);
15
        this.listModules(db);
16
    }
17
 
18
    public void listCommands(Database db)
19
    {
20
        ArrayList<Command> commands = db.getCommands();
21
 
22
        System.out.println("Found " + commands.size() + " commands.");
23
        System.out.println("===============================");
24
 
25
        Iterator<Command> iterator = commands.iterator();
26
 
27
        while (iterator.hasNext())
28
        {
29
            System.out.println(iterator.next().toString());
30
        }
31
    }
32
 
33
    public void listClasses(Database db)
34
    {
35
        ArrayList<CanClass> classes = db.getClasses();
36
 
37
        System.out.println("Found " + classes.size() + " classes.");
38
        System.out.println("===============================");
39
 
40
        Iterator<CanClass> iterator = classes.iterator();
41
 
42
        while (iterator.hasNext())
43
        {
44
            System.out.println(iterator.next().toString());
45
        }
46
    }
47
 
48
    public void listModules(Database db)
49
    {
50
        ArrayList<Module> modules = db.getModules();
51
 
52
        System.out.println("Found " + modules.size() + " module types.");
53
        System.out.println("===============================");
54
 
55
        Iterator<Module> iterator = modules.iterator();
56
 
57
        while (iterator.hasNext())
58
        {
59
            System.out.println(iterator.next().toString());
60
        }
61
    }
62
 
63
    public void listCommandTypes(Database db)
64
    {
65
        ArrayList<CommandType> commandTypes = db.getCommandTypes();
66
 
67
        Iterator<CommandType> iterator = commandTypes.iterator();
68
 
69
        System.out.println("Found " + commandTypes.size() + " command types.");
70
        System.out.println("===============================");
71
 
72
        while (iterator.hasNext())
73
        {
74
            System.out.println(iterator.next().toString());
75
        }
76
    }
77
 
78
    public void listSendingTypes(Database db)
79
    {
80
        ArrayList<SendingType> sendingTypes = db.getSendingTypes();
81
 
82
        Iterator<SendingType> iterator = sendingTypes.iterator();
83
 
84
        System.out.println("Found " + sendingTypes.size() + " sending types.");
85
        System.out.println("===============================");
86
 
87
        while (iterator.hasNext())
88
        {
89
            System.out.println(iterator.next().toString());
90
        }
91
    }
92
 
93
    public void listDirectionTypes(Database db)
94
    {
95
        ArrayList<DirectionType> directionTypes = db.getDirectionTypes();
96
 
97
        Iterator<DirectionType> iterator = directionTypes.iterator();
98
 
99
        System.out.println("Found " + directionTypes.size() + " direction types.");
100
        System.out.println("===============================");
101
 
102
        while (iterator.hasNext())
103
        {
104
            System.out.println(iterator.next().toString());
105
        }
106
    }
107
}