01: /*
02: * This program is free software; you can redistribute it and/or modify
03: * it under the terms of the GNU General Public License as published by
04: * the Free Software Foundation; either version 2 of the License, or
05: * (at your option) any later version.
06: *
07: * This program is distributed in the hope that it will be useful,
08: * but WITHOUT ANY WARRANTY; without even the implied warranty of
09: * 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;
19:
20: import web.security.Range;
21:
22: /**
23: * 可操作范围的实现类
24: * @author liudong
25: */
26: public class RangeImpl implements Range, Serializable {
27:
28: protected String name;
29: protected String desc;
30:
31: public RangeImpl() {
32: }
33:
34: public RangeImpl(String name) {
35: this .name = name;
36: }
37:
38: public RangeImpl(String name, String desc) {
39: this .name = name;
40: this .desc = desc;
41: }
42:
43: /* (non-Javadoc)
44: * @see com.clickcom.web.security.Range#equals(com.clickcom.web.security.Range)
45: */
46: public boolean equals(Range range) {
47: boolean be = false;
48: if (name != null && range != null)
49: be = name.equals(range.getName());
50: return be;
51: }
52:
53: /* (non-Javadoc)
54: * @see web.security.Range#getName()
55: */
56: public String getName() {
57: return name;
58: }
59:
60: public void setName(String name) {
61: this .name = name;
62: }
63:
64: public String getDesc() {
65: return desc;
66: }
67:
68: public void setDesc(String desc) {
69: this .desc = desc;
70: }
71:
72: public String toString() {
73: return "RANGE[" + getClass().getName() + "]:(" + name + ','
74: + desc + ')';
75: }
76: }
|