Subversion Repositories HomeAutomation

Rev

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

Rev Author Line No. Line
915 migan 1
package items;
2
 
3
import java.util.ArrayList;
4
 
5
public class SupportedCommand
6
{
7
    private String name;
8
    private DirectionType direction;
9
    private ArrayList<SendingType> sendingTypes;
10
    private Module module;
11
    private CanClass canClass;
12
 
13
    public SupportedCommand()
14
    {
15
        this.sendingTypes = new ArrayList<SendingType>();
16
    }
17
 
18
    public String getName()
19
    {
20
        return name;
21
    }
22
 
23
    public void setName(String name)
24
    {
25
        this.name = name;
26
    }
27
 
28
    public DirectionType getDirection()
29
    {
30
        return direction;
31
    }
32
 
33
    public void setDirection(DirectionType direction)
34
    {
35
        this.direction = direction;
36
    }
37
 
38
    public ArrayList<SendingType> getSendingTypes()
39
    {
40
        return sendingTypes;
41
    }
42
 
43
    public void setSendingTypes(ArrayList<SendingType> sendingTypes)
44
    {
45
        this.sendingTypes = sendingTypes;
46
    }
47
 
48
    public void addSendingTypes(SendingType sendingType)
49
    {
50
        this.sendingTypes.add(sendingType);
51
    }
52
 
53
    public Module getModule()
54
    {
55
        return module;
56
    }
57
 
58
    public void setModule(Module module)
59
    {
60
        this.module = module;
61
    }
62
 
63
    public CanClass getCanClass()
64
    {
65
        return canClass;
66
    }
67
 
68
    public void setCanClass(CanClass canClass)
69
    {
70
        this.canClass = canClass;
71
    }
72
 
73
    public String getSendingTypesString()
74
    {
75
        String result = "";
76
 
77
        for (int j = 0; j < this.sendingTypes.size(); j++)
78
        {
79
            result += this.sendingTypes.get(j).getName();
80
 
81
            if (j+1 < this.sendingTypes.size())
82
            {
83
                result += ",";
84
            }
85
        }
86
 
87
        return result;
88
    }
89
 
90
    public String toString()
91
    {
92
        return this.getName() + " - Direction: " + this.getDirection().getName() + ", Sending types(" + this.getSendingTypesString() + ")\n";
93
    }
94
}