KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > java > guards > SectionDescriptor


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.java.guards;
21
22 /** Class for holding information about the one special (guarded)
23 * comment. It is created by GuardedReader and used by
24 * JavaEditor to creating the guarded sections.
25 */

26 public final class SectionDescriptor {
27     /** Type - one of T_XXX constant */
28     private GuardTag type;
29
30     /** Name of the section comment */
31     private String JavaDoc name;
32
33     /** offset of the begin */
34     private int begin;
35
36     /** offset of the end */
37     private int end;
38
39     /** Simple constructor */
40     public SectionDescriptor(GuardTag type) {
41         this.type = type;
42         name = null;
43         begin = 0;
44         end = 0;
45     }
46     
47     public SectionDescriptor(GuardTag type, String JavaDoc name, int begin, int end) {
48         this.type = type;
49         this.name = name;
50         this.begin = begin;
51         this.end = end;
52     }
53
54     /** offset of the begin */
55     public int getBegin() {
56         return begin;
57     }
58
59     /** Name of the section comment */
60     public String JavaDoc getName() {
61         return name;
62     }
63
64     /** offset of the end */
65     public int getEnd() {
66         return end;
67     }
68
69     public GuardTag getType() {
70         return type;
71     }
72
73     public void setBegin(int begin) {
74         this.begin = begin;
75     }
76
77     public void setEnd(int end) {
78         this.end = end;
79     }
80
81     public void setName(String JavaDoc name) {
82         this.name = name;
83     }
84
85
86 }
87
Popular Tags