-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathNSConnParameterList.java
More file actions
117 lines (95 loc) · 1.89 KB
/
Copy pathNSConnParameterList.java
File metadata and controls
117 lines (95 loc) · 1.89 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
package com.nullspace.dao;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Collections;
public class NSConnParameterList
{
public enum MJConnParameterType
{
P_INT(0),
P_STRING(1),
P_REAL(2),
P_TIME(3),
P_BOOLEAN(4);
private final int value;
MJConnParameterType(int value)
{
this.value = value;
}
public int getValue()
{
return value;
}
}
public class MJConnParameter implements Comparable<MJConnParameter>
{
public MJConnParameterType mType;
public Integer mSortId;
public String mValue;
public int toInt()
{
return Integer.valueOf(mValue);
}
public MJConnParameter()
{
}
public MJConnParameter(MJConnParameterType type, int id, String value)
{
mType = type;
mSortId = id;
mValue = value;
}
public String toString()
{
return mValue;
}
public float toReal()
{
return Float.valueOf(mValue);
}
public boolean toBoolean()
{
return Boolean.valueOf(mValue);
}
public Timestamp toTimestamp()
{
return Timestamp.valueOf(mValue);
}
public NSConnParameterList toList()
{
NSConnParameterList list = new NSConnParameterList();
list.AddParam(this);
return list;
}
@Override
public int compareTo(MJConnParameter o) {
// TODO Auto-generated method stub
return mSortId.compareTo(o.mSortId);
}
}
ArrayList<MJConnParameter> mParamList;
public NSConnParameterList()
{
mParamList = new ArrayList<>();
}
public void AddParam(MJConnParameterType type, int id, String value)
{
AddParam(new MJConnParameter(type, id, value));
}
public void AddParam(MJConnParameter param)
{
mParamList.add(param);
}
public void Sort()
{
Collections.sort(mParamList);
}
public int Size()
{
return mParamList.size();
}
public MJConnParameter GetAt(int index)
{
return mParamList.get(index);
}
}