View Javadoc

1    /*
2     * This is free software; you can redistribute it and/or modify it
3     * under the terms of the GNU Lesser General Public License as
4     * published by the Free Software Foundation; either version 2.1 of
5     * the License, or (at your option) any later version.
6     *
7     * This software is distributed in the hope that it will be useful,
8     * but WITHOUT ANY WARRANTY; without even the implied warranty of
9     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10    * Lesser General Public License for more details.
11    *
12    * You should have received a copy of the GNU Lesser General Public
13    * License along with this software; if not, write to the Free
14    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
15    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
16    */
17  
18  package installtoolkit;
19  
20  /**
21   * Helper class to store a pattern construct from the descriptor file
22   * 
23   * @author Christian Elberfeld <elberfeld@web.de>
24   */
25  public class Pattern {
26  
27  	
28  	private String pattern;
29  	private boolean invert;
30  	
31  	/**
32  	 * Construct the pattern 
33  	 * 
34  	 * @param pattern the pattern string
35  	 * @param invert true if this pattern excludes files, false if this pattern includes files 
36  	 */
37  	public Pattern(String pattern, boolean invert) {
38  
39  		this.pattern = pattern;
40  		this.invert = invert;
41  	}
42  
43  	/**
44  	 * @see Object#toString()
45  	 */
46  	@Override
47  	public String toString() {
48  		
49  		return "Pattern [pattern: "+this.pattern+" / invert: "+this.invert+"]";
50  	}
51  
52  	public boolean isInvert() {
53  		return invert;
54  	}
55  
56  	public String getPattern() {
57  		return pattern;
58  	}	
59  	
60  	
61  }