-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathVCommand.java
More file actions
57 lines (47 loc) · 1.1 KB
/
VCommand.java
File metadata and controls
57 lines (47 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package vMon;
/***
The VCommand class saves the name, the description and the value of an vctrld command
***/
public class VCommand {
private String mName = new String();
private String mDescription = new String();
private String mValue = new String ();
public VCommand (String theString)
{
String[] parts = theString.split(": ");
setmName(parts[0]);
setmDescription(parts[1]);
}
public boolean updateValue(String theValue)
{
if (theValue != getmValue())
{
setValue(theValue);
return true;
}
return false;
}
private void setValue(String theValue)
{
setmValue(theValue);
}
public String getmName() {
return mName;
}
private void setmName(String mName) {
this.mName = mName;
}
public String getmDescription() {
return mDescription;
}
private void setmDescription(String mDescription) {
this.mDescription = mDescription;
}
public String getmValue() {
return mValue;
}
public void setmValue(String mValue) {
String lines[] = mValue.split("\\r?\\n");
this.mValue = lines[0].replaceAll("\\s+$", "");
}
}