Source code: jsource/codegenerator/Property.java
1 package jsource.codegenerator;
2
3
4 /**
5 * Property.java 03/17/03
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Library General Public License as published
9 * by the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Library General Public License for more details.
16 */
17
18 public class Property {
19
20 private String m_sName = null;
21 private int m_iType = 0;
22 private boolean m_bReadOnly = false;
23
24 public Property(String name, int type) {
25 this(name, type, false);
26 }
27
28 public Property(String name, int type, boolean read_only) {
29 m_bReadOnly = false;
30 m_sName = name;
31 m_iType = type;
32 m_bReadOnly = read_only;
33 }
34
35 public String getName() {
36 return m_sName;
37 }
38
39 public void setName(String name) {
40 m_sName = name;
41 }
42
43 public int getType() {
44 return m_iType;
45 }
46
47 public void setType(int i_type) {
48 m_iType = i_type;
49 }
50
51 public boolean isReadOnly() {
52 return m_bReadOnly;
53 }
54
55 public void setReadOnly(boolean value) {
56 m_bReadOnly = value;
57 }
58
59 public boolean equals(Object o) {
60 try {
61 Property p = (Property) o;
62
63 return m_sName.equals(p.m_sName);
64 } catch (ClassCastException ex) {
65 return false;
66 }
67 }
68
69 public int hashCode() {
70 return m_sName.hashCode();
71 }
72 }