svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libTools / src / org / gvsig / tools / evaluator / EvaluatorFieldValue.java @ 24261
History | View | Annotate | Download (2.41 KB)
1 | 24016 | jjdelcerro | package org.gvsig.tools.evaluator; |
---|---|---|---|
2 | |||
3 | public class EvaluatorFieldValue { |
||
4 | |||
5 | final public static int MATCH = 0; |
||
6 | final public static int RANGE = 1; |
||
7 | final public static int NEAREST = 2; |
||
8 | |||
9 | private int type; |
||
10 | private Object value1; |
||
11 | private Object value2; |
||
12 | private int count; |
||
13 | private int tolerance; |
||
14 | private String fieldName; |
||
15 | |||
16 | public EvaluatorFieldValue(String fieldName, Object value) { |
||
17 | this.fieldName = fieldName;
|
||
18 | this.type = MATCH;
|
||
19 | this.value1 = value;
|
||
20 | this.value2 = null; |
||
21 | this.count = -1; |
||
22 | this.tolerance = -1; |
||
23 | } |
||
24 | |||
25 | public EvaluatorFieldValue(String fieldName, Object value1, Object value2) { |
||
26 | this.fieldName = fieldName;
|
||
27 | this.type = RANGE;
|
||
28 | this.value1 = value1;
|
||
29 | this.value2 = value2;
|
||
30 | this.count = -1; |
||
31 | this.tolerance = -1; |
||
32 | } |
||
33 | |||
34 | public EvaluatorFieldValue(String fieldName, int count, int tolerance, |
||
35 | Object value) {
|
||
36 | this.fieldName = fieldName;
|
||
37 | this.type = NEAREST;
|
||
38 | this.count = count;
|
||
39 | this.tolerance = tolerance;
|
||
40 | this.value1 = value;
|
||
41 | this.value2 = null; |
||
42 | } |
||
43 | |||
44 | public EvaluatorFieldValue(String fieldName, int count, Object value) { |
||
45 | this.fieldName = fieldName;
|
||
46 | this.type = NEAREST;
|
||
47 | this.count = count;
|
||
48 | this.tolerance = -1; |
||
49 | this.value1 = value;
|
||
50 | this.value2 = null; |
||
51 | } |
||
52 | |||
53 | /**
|
||
54 | * Get the type of operation realiced over the field.
|
||
55 | *
|
||
56 | * The posibles values are: MATCH RANGE or NEAREST
|
||
57 | *
|
||
58 | * @return an int with the type of operation
|
||
59 | */
|
||
60 | public int getType() { |
||
61 | return this.type; |
||
62 | } |
||
63 | |||
64 | /**
|
||
65 | * Get the fieldName over the operation is realiced.
|
||
66 | *
|
||
67 | * @return String name of field.
|
||
68 | */
|
||
69 | public String getFieldName() { |
||
70 | return this.fieldName; |
||
71 | } |
||
72 | |||
73 | /**
|
||
74 | * Get the count used in the nearest operation.
|
||
75 | *
|
||
76 | * @return the count or -1 if not aplicable.
|
||
77 | */
|
||
78 | public int getCount() { |
||
79 | return this.count; |
||
80 | } |
||
81 | |||
82 | /**
|
||
83 | * Get the tolerance used in the nearest operation.
|
||
84 | *
|
||
85 | * @return the tolerance or -1 if not aplicable.
|
||
86 | */
|
||
87 | public int getTolerance() { |
||
88 | return this.tolerance; |
||
89 | } |
||
90 | |||
91 | /**
|
||
92 | * Get the value used in the match or nearest operation.
|
||
93 | *
|
||
94 | * @return the match value or null if not aplicable.
|
||
95 | */
|
||
96 | public Object getValue() { |
||
97 | return this.value1; |
||
98 | } |
||
99 | |||
100 | /**
|
||
101 | * Get the initial value used in the range operation.
|
||
102 | *
|
||
103 | * @return the first value or null if not aplicable.
|
||
104 | */
|
||
105 | public Object getValue1() { |
||
106 | return this.value1; |
||
107 | } |
||
108 | |||
109 | /**
|
||
110 | * Get the final value used in the range operation.
|
||
111 | *
|
||
112 | * @return the final value or null if not aplicable.
|
||
113 | */
|
||
114 | public Object getValue2() { |
||
115 | return this.value2; |
||
116 | } |
||
117 | } |