~ubuntu-branches/ubuntu/raring/ant-contrib/raring

« back to all changes in this revision

Viewing changes to src/main/java/net/sf/antcontrib/design/Package.java

  • Committer: Bazaar Package Importer
  • Author(s): Michael Koch
  • Date: 2009-09-26 08:45:47 UTC
  • Revision ID: james.westby@ubuntu.com-20090926084547-ynj34y27mg9dr60c
Tags: upstream-1.0~b3+svn177
ImportĀ upstreamĀ versionĀ 1.0~b3+svn177

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2001-2004 Ant-Contrib project.  All rights reserved.
 
3
 *
 
4
 * Licensed under the Apache License, Version 2.0 (the "License");
 
5
 * you may not use this file except in compliance with the License.
 
6
 * You may obtain a copy of the License at
 
7
 *
 
8
 *     http://www.apache.org/licenses/LICENSE-2.0
 
9
 *
 
10
 * Unless required by applicable law or agreed to in writing, software
 
11
 * distributed under the License is distributed on an "AS IS" BASIS,
 
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
13
 * See the License for the specific language governing permissions and
 
14
 * limitations under the License.
 
15
 */
 
16
package net.sf.antcontrib.design;
 
17
 
 
18
import java.util.ArrayList;
 
19
import java.util.HashSet;
 
20
import java.util.List;
 
21
import java.util.Set;
 
22
 
 
23
 
 
24
/*
 
25
 * Created on Aug 24, 2003
 
26
 *
 
27
 * To change the template for this generated file go to
 
28
 * Window>Preferences>Java>Code Generation>Code and Comments
 
29
 */
 
30
/**
 
31
 * FILL IN JAVADOC HERE
 
32
 *
 
33
 * @author Dean Hiller(dean@xsoftware.biz)
 
34
 */
 
35
public class Package {
 
36
    
 
37
    public final static String DEFAULT = "default package";
 
38
    private String name;
 
39
    private String pack;
 
40
    
 
41
    //holds the name attribute of the package element of each
 
42
    //package this package depends on.
 
43
    private List depends;
 
44
    private Set unusedDepends = new HashSet();
 
45
    private boolean isIncludeSubpackages;
 
46
    private boolean needDeclarations;
 
47
    private boolean needDepends;
 
48
    private boolean isUsed = false;
 
49
 
 
50
    public void setName(String name) {
 
51
        if("".equals(name))
 
52
            name = DEFAULT;
 
53
        this.name = name;
 
54
    }
 
55
    public String getName() {
 
56
        return name;
 
57
    }
 
58
        
 
59
    public void setPackage(String pack) {
 
60
        this.pack = pack;
 
61
    }
 
62
    
 
63
    public String getPackage() {
 
64
        return pack;
 
65
    }
 
66
 
 
67
    public void addDepends(Depends d) {
 
68
        if(depends == null)
 
69
            depends = new ArrayList();
 
70
        depends.add(d);
 
71
        unusedDepends.add(d);
 
72
    }
 
73
    
 
74
    public Depends[] getDepends() {
 
75
        Depends[] d = new Depends[0];
 
76
        if(depends == null)
 
77
            return d;
 
78
        return (Depends[])depends.toArray(d);
 
79
    }
 
80
    
 
81
    /**
 
82
     * @param b
 
83
     */
 
84
    public void setIncludeSubpackages(boolean b) {
 
85
        isIncludeSubpackages = b;
 
86
    }
 
87
    /**
 
88
     * @return
 
89
     */
 
90
    public boolean isIncludeSubpackages() {
 
91
        return isIncludeSubpackages;
 
92
    }
 
93
    /**
 
94
     * @param b
 
95
     */
 
96
    public void setNeedDeclarations(boolean b) {
 
97
        needDeclarations = b;
 
98
    }
 
99
    /**
 
100
     * @return
 
101
     */
 
102
    public boolean isNeedDeclarations() {
 
103
        return needDeclarations;
 
104
    }
 
105
    /**
 
106
     * @param b
 
107
     */
 
108
    public void setNeedDepends(boolean b) {
 
109
        needDepends = b;
 
110
    }
 
111
    
 
112
    public boolean getNeedDepends() {
 
113
        return needDepends;
 
114
    }
 
115
    /**
 
116
     * @param b
 
117
     */
 
118
    public void setUsed(boolean b)
 
119
    {
 
120
        isUsed  = b;
 
121
    }
 
122
    public boolean isUsed()
 
123
    {
 
124
        return isUsed;
 
125
    }
 
126
    /**
 
127
     * @param d
 
128
     */
 
129
    public void addUsedDependency(Depends d)
 
130
    {
 
131
        unusedDepends.remove(d);
 
132
    }
 
133
    
 
134
    public Set getUnusedDepends() {
 
135
        return unusedDepends;
 
136
    }
 
137
    
 
138
}
 
139