View Javadoc

1   /*
2    * Copyright 2004-2006 the Seasar Foundation and the Others.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
13   * either express or implied. See the License for the specific language
14   * governing permissions and limitations under the License.
15   */
16  /*
17   * Created on 2005/09/09
18   *
19   * TODO To change the template for this generated file go to
20   * Window - Preferences - Java - Code Style - Code Templates
21   */
22  package org.seasar.tuigwaa.database.function.criteria;
23  
24  /***
25   * @author nishioka
26   * 
27   * TODO To change the template for this generated type comment go to Window -
28   * Preferences - Java - Code Style - Code Templates
29   */
30  public abstract class AbstractCriteriaFunction implements
31  		CriteriaFunction{
32  
33  	private String field_;
34  
35  	private Object value_;
36  
37  	private String option;
38  
39  	private String name;
40  
41  	public AbstractCriteriaFunction() {
42  	}
43  
44  	public AbstractCriteriaFunction(String field) {
45  		this.field_ = field;
46  	}
47  
48  	public AbstractCriteriaFunction(String field, Object value) {
49  		this.field_ = field;
50  		this.value_ = value;
51  	}
52  
53  	//[End] ----- evaluate Method ------
54  
55  	public Object evaluate(Object obj) {
56  		return evaluate((ICriteria) obj);
57  	}
58  
59  	public abstract Object evaluate(ICriteria criteria);
60  
61  	public Object evaluate(Object left, Object right) {
62  		return evaluate((ICriteria) left, right);
63  	}
64  
65  	public abstract Object evaluate(ICriteria criteria, Object right);
66  
67  	//[End] ----- evaluate Method ------
68  
69  	//[Start] ----- Setter Getter Metdhod ------
70  	
71  	public final void setValue(Object value) {
72  		this.value_ = value;
73  	}
74  
75  	public final void setField(String field) {
76  		this.field_ = field;
77  	}
78  
79  	public final Object getValue() {
80  		return this.value_;
81  	}
82  
83  	public final String getField() {
84  		return this.field_;
85  	}
86  
87  	public final String getOption() {
88  		return option;
89  	}
90  
91  	public final void setOption(String option) {
92  		this.option = option;
93  	}
94  
95  	public final void setName(String name) {
96  		this.name = name;
97  	}
98  
99  	public final String getName() {
100 		return name;
101 	}
102 
103 	//[Start] ----- Setter Getter Metdhod ------
104 }