KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mdarad > framework > util > struts > criteria > CriterionFormPattern


1 /*
2     Mdarad-Toolobox is a collection of tools for Architected RAD
3     (Rapid Application Development) based on an MDA approach.
4     The toolbox contains frameworks and generators for many environments
5     (JAVA, J2EE, Hibernate, .NET, C++, etc.) which allow to generate
6     applications from a design Model
7     Copyright (C) 2004-2005 Elapse Technologies Inc.
8
9     This library is free software; you can redistribute it and/or
10     modify it under the terms of the GNU General Public
11     License as published by the Free Software Foundation; either
12     version 2.1 of the License, or (at your option) any later version.
13
14     This library is distributed in the hope that it will be useful,
15     but WITHOUT ANY WARRANTY; without even the implied warranty of
16     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17     General Public License for more details.
18
19     You should have received a copy of the GNU General Public
20     License along with this library; if not, write to the Free Software
21     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */

23 package org.mdarad.framework.util.struts.criteria;
24
25 import org.mdarad.framework.enumeration.AllowableValue;
26
27 /**
28  * This class is a enumeration element for the displaying patterns
29  * of a query criterion. For more information on displaying patterns,
30  * see the class {@link CriterionFormPatterns CriterionFormPatterns}
31  * @author Philippe Brouillette
32  * @version 1.0
33  */

34 public class CriterionFormPattern extends AllowableValue {
35
36     /**
37      * Public constructor that initializes the value and the
38      * label of the allowable value
39      * @param value String that represents the value
40      * @param label Label associated to the allowable value
41      */

42     public CriterionFormPattern(String JavaDoc value, String JavaDoc label) {
43         super(value, label);
44     }
45
46     /**
47      * Indicates whether some CriterionFormPattern object is equals to this one
48      * @param obj Object that must be an instance of CriterionFormPattern
49      * @return true if this object is the same as the obj argument; false otherwise.
50      * @exception IllegalArgumentException Thown if the object is not of type CriterionFormPattern
51      * @see java.lang.Object#equals(java.lang.Object)
52      */

53     public boolean equals(Object JavaDoc obj) {
54         if (!(obj instanceof CriterionFormPattern)) {
55             throw new IllegalArgumentException JavaDoc("The object to be compared is of the wrong type");
56         }
57         
58         CriterionFormPattern operObj = (CriterionFormPattern) obj;
59         return this.getValue().equals(operObj.getValue());
60     }
61 }
Popular Tags