1
2
3
4
5
6
7
8 package com.buckosoft.PicMan.domain;
9
10 import java.util.LinkedList;
11 import java.util.List;
12
13
14
15
16
17
18
19
20
21 public class MetaSet {
22 public final static int NAME = 0;
23 public final static int OPERATOR = 1;
24 public final static int FUNCTION = 2;
25
26 public final static int NONE = 0;
27 public final static int AND = 1;
28 public final static int OR = 2;
29 public final static int NOT = 3;
30
31 public final static String s_NONE = "NONE";
32 public final static String s_AND = "AND";
33 public final static String s_OR = "OR";
34 public final static String s_NOT = "NOT";
35 public final static String s_UNKNOWN = "UNKNOWN";
36
37
38 public final static int LT = 1;
39 public final static int GT = 2;
40 public final static int EQ = 3;
41 public final static int NE = 4;
42
43 public final static String s_LT = "<";
44 public final static String s_GT = ">";
45 public final static String s_EQ = "=";
46 public final static String s_NE = "!=";
47
48 public final static String[] rateOps = { "", s_LT, s_GT, s_EQ, s_NE };
49
50
51 public static final int MAX_RULES = 51;
52
53 private int sid = -1;
54 private LinkedList<MetaSetRule> list = new LinkedList<MetaSetRule>();
55
56
57
58
59 public int getSid() {
60 return sid;
61 }
62
63
64
65 public void setSid(int sid) {
66 this.sid = sid;
67 }
68
69
70
71 public int getRuleCount() {
72 return(list.size());
73 }
74
75
76
77
78 public List<MetaSetRule> getRules() {
79 return(list);
80 }
81
82
83
84
85
86 public MetaSetRule getRule(int index) {
87 if (index < this.getRuleCount())
88 return((MetaSetRule)list.get(index));
89 return(null);
90 }
91
92
93
94
95 public void addRule(MetaSetRule rule) {
96 if (rule.getIndex() == -1)
97 this.list.add(rule);
98 else
99 this.list.add(rule.getIndex(), rule);
100 }
101 }