01: package org.drools.lang.descr;
02:
03: /*
04: * Copyright 2005 JBoss Inc
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18:
19: import java.io.Serializable;
20:
21: /**
22: * This is the super type for all pattern AST nodes.
23: */
24: public class BaseDescr implements Serializable {
25:
26: private static final long serialVersionUID = 400L;
27: private int startCharacter = -1;
28: private int endCharacter = -1;
29: private int line = -1;
30: private int column = -1;
31: private int endLine = -1;
32: private int endColumn = -1;
33: private String text = "";
34:
35: public String getText() {
36: return text;
37: }
38:
39: public void setText(String text) {
40: this .text = text;
41: }
42:
43: public void setLocation(final int line, final int column) {
44: this .line = line;
45: this .column = column;
46: }
47:
48: public void setEndLocation(final int line, final int column) {
49: this .endLine = line;
50: this .endColumn = column;
51: }
52:
53: public int getLine() {
54: return this .line;
55: }
56:
57: public int getColumn() {
58: return this .column;
59: }
60:
61: public int getEndLine() {
62: return this .endLine;
63: }
64:
65: public int getEndColumn() {
66: return this .endColumn;
67: }
68:
69: /**
70: * @return the endCharacter
71: */
72: public int getEndCharacter() {
73: return this .endCharacter;
74: }
75:
76: /**
77: * @param endCharacter the endCharacter to set
78: */
79: public void setEndCharacter(final int endCharacter) {
80: this .endCharacter = endCharacter;
81: }
82:
83: /**
84: * @return the startCharacter
85: */
86: public int getStartCharacter() {
87: return this .startCharacter;
88: }
89:
90: /**
91: * @param startCharacter the startCharacter to set
92: */
93: public void setStartCharacter(final int startCharacter) {
94: this.startCharacter = startCharacter;
95: }
96: }
|