KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > web > security > impl > RangeImpl


1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 2 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU Library General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15  */

16 package web.security.impl;
17
18 import java.io.Serializable JavaDoc;
19
20 import web.security.Range;
21
22 /**
23  * 可操作范围的实现类
24  * @author liudong
25  */

26 public class RangeImpl implements Range, Serializable JavaDoc {
27
28     protected String JavaDoc name;
29     protected String JavaDoc desc;
30     
31     public RangeImpl(){
32     }
33
34     public RangeImpl(String JavaDoc name){
35         this.name = name;
36     }
37     
38     public RangeImpl(String JavaDoc name, String JavaDoc desc){
39         this.name = name;
40         this.desc = desc;
41     }
42     /* (non-Javadoc)
43      * @see com.clickcom.web.security.Range#equals(com.clickcom.web.security.Range)
44      */

45     public boolean equals(Range range) {
46         boolean be = false;
47         if(name!=null && range!=null)
48             be = name.equals(range.getName());
49         return be;
50     }
51     /* (non-Javadoc)
52      * @see web.security.Range#getName()
53      */

54     public String JavaDoc getName() {
55         return name;
56     }
57
58     public void setName(String JavaDoc name) {
59         this.name = name;
60     }
61     public String JavaDoc getDesc() {
62         return desc;
63     }
64     public void setDesc(String JavaDoc desc) {
65         this.desc = desc;
66     }
67     public String JavaDoc toString() {
68         return "RANGE["+getClass().getName()+"]:("+name+','+desc+')';
69     }
70 }
71
Popular Tags